Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #fread #condition
ADD COMMENT
Topic
Name
5+4 =