1FILE *write_ptr;
2
3write_ptr = fopen("test.bin","wb"); // w for write, b for binary
4
5fwrite(buffer,sizeof(buffer),1,write_ptr); // write 10 bytes from our buffer
1unsigned char buffer[10];
2FILE *ptr;
3
4ptr = fopen("test.bin","rb"); // r for read, b for binary
5
6fread(buffer,sizeof(buffer),1,ptr); // read 10 bytes to our buffer