文件读写的问题 运行的是乱码
#include <stdio.h>#include <stdlib.h>
void main ()
{
FILE *fp;
char ch1[5];
char ch2[5];
char ch3[5];
int a,b;
if((fp=fopen("Student.txt","r"))==NULL)
{
printf("Cannot open file strike any key exit!");
getchar();
exit(1);
}
while(!feof(fp))
{
fscanf(fp,"%d%s%s%d%s",&a,ch1,ch2,&b,ch3);
printf("%5d%s%s%5d%s",a,ch1,ch2,b,ch3);
}
fclose(fp);
}//运行的是乱码,哪里出错了,求解