这些代码块之间有什么不同.我试图搜索"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);
}
Run Code Online (Sandbox Code Playgroud)
和
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);
}
Run Code Online (Sandbox Code Playgroud)