Answers for "fread condition"

C
0

fread condition

FILE* file = fopen(filename, "rb");
char buffer[4];

if (file) {
    /* File was opened successfully. */
    
    /* Attempt to read */
    while (fread(buffer, sizeof *buffer, 4, file) == 4) {
        /* byte swap here */
    }

    fclose(file);
}
Posted by: Guest on August-13-2021

Code answers related to "C"

Browse Popular Code Answers by Language