这些代码块有何区别?我试图查找“wb”,但没有找到。包含“wb”的文件来自我的一位导师。
这些代码块有何不同?我尝试搜索“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);
}