【发布时间】:2017-10-02 08:09:24
【问题描述】:
这些代码块之间有什么不同。我试图搜索“wb”,但在任何地方都看不到它。包含“wb”的文件来自我的一位导师
FILE *f = fopen(DB_FILE_NAME, "wb");
if (f == NULL) {
printf("Write error\n");
} else {
/* write n_students elements of the studentlist array */
fwrite(studentlist, sizeof(student_t), n_students, f);
fclose(f);
}
和
FILE *f = fopen(DB_FILE_NAME, "w");
if (f == NULL) {
printf("Write error\n");
} else {
/* write n_students elements of the studentlist array */
fwrite(studentlist, sizeof(student_t), n_students, f);
fclose(f);
}
【问题讨论】: