呵呵,满意的话要给我追加分哦!那两个例子都是我自己给你写的.
#include"stdio.h"
#include"stdlib.h"
main()
{
FILE *fp;
char s[100];
exit(0);
}
printf("Please input your name:");
gets(s);
fclose(fp);
struct score
int a;
}d[N];
int i,no=0;
for(i=0;i no++; for(i=0;i Name:ytyh Score:1 在ASCII文件中我只知道这样,但在二进制文件中就没有这么麻烦,直接用fread就行. struct MyStruct s; FILE * fp; ...... fwrite(&s, sizeof(s), 1, fp); if((fp1=fopen("此差student.txt","w"))==NULL) for(i=0;i {scanf("%s,%s,%d,%f,%d,%f,%d,%f",student[i].no,student[i].name,&student[i].eng,&student[i].point1, fprintf(fp1,"%s,%s,%d,%f,%d,%f,%d,%f",student[i].no,student[i].name,student[i].eng,student[i].point1, 给数组Array赋值你想输出到文件的数据就行了 你的意思是要自己手动输入数扒敏据,然春誉枝后写入文件虚竖吗? 如果是的话,就在//write the elements in array into the file这里加上: for(i=0;i scanf("%f",Array[i]); 以上就是土嘎嘎小编大虾米为大家整理的相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!