I have some binary data in a file. In order to read all the data, I did this:
// open the file
// ...
// now read the file
char data;
while (fread(&data, sizeof(char), 1, input) == 1) {
// do something
}
Well, this worked finely but my teacher said I shouldn't read a file line by line because this would increase the amount of I/O. So now I need to read the whole binary file at a time. How can I do this? Could anyone help?