[求助]关于文件输入输出问题(不知道错在哪里)
#include<stdio.h>main()
{
int n,i,j,m;
char str[100][100],ch;
FILE *p;
scanf("%d",&n);
if((p=fopen("stu.dat","w+"))==NULL)
{
fprintf(stderr,"´ò¿ª´íÎó");
exit(1);
}
for(i=0;i<n;i++){
gets(str[i]);
fputs(str[i],p);
}
ch=fgetc(p);
while(!feof(p))
{
if(ch>=97&&ch<=122)
ch-=32;
putchar(ch);
ch=fgetc(p);
}
fclose(p);
}