#include<stdio.h>
#include<stdlib.h>
int main( void ){
FILE *fp;
if((fp = fopen("text.txt","wb")) == NULL){
perror("fopen");
return -1;
}
char ch = 'c';
int i = 0;
for(i = 0;i < 5;i++){
fwrite(&ch,sizeof(ch),1,fp);
fflush(fp);
}
fclose(fp);
return 0;
}
我在fopen 的时候打开的文件是只读权限,但是到了fwrite 函数之后怎么会有写命令啊
慕雪6442864
哔哔one