fread condition

Solutions on MaxInterview for fread condition by the best coders in the world

showing results for - "fread condition"
Halle
26 Aug 2016
1FILE* file = fopen(filename, "rb");
2char buffer[4];
3
4if (file) {
5    /* File was opened successfully. */
6    
7    /* Attempt to read */
8    while (fread(buffer, sizeof *buffer, 4, file) == 4) {
9        /* byte swap here */
10    }
11
12    fclose(file);
13}
14
similar questions
fread
queries leading to this page
fread conditionfread condition