#defineBUFLEN80/*缓冲区最大字符数*/
voidreadfile()/*建立信息*/
{
charbuf[BUFLEN],*p=\"student.dat\";
FILE*fp;
inti=0;
if((fp=fopen(\"student.dat\",\"r\"))==NULL)
{printf(\"Openfile%serror!Strikeanykeytoexit!\",p);
system(\"pause\");
exit(0);
}
while(fscanf(fp,\"%s%s%d%s%s%s%s%s\",stu.code,stu.name,
i=i;
}
fclose(fp);
n=i;
printf(\"录入完毕!\\n\");
}
这个c语言片段中:charbuf[BUFLEN],*p=\"student.dat\";有什么作用啊?可不可以把这个片段改一下,把它弄简单点
|