📜  fread 条件 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:34.850000             🧑  作者: Mango

代码示例1
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);
}