#include <STDIO.H>
#include <conio.h>
int main()
{
FILE *fStream = NULL;
int iReturn = 1;
char ch;
fStream = fopen("d:\\wimrepairread.txt","r+");
if (fStream != NULL)
{
fseek(fStream,0,SEEK_SET);
while((ch = fgetc(fStream))&&(ch != EOF))
{
putchar(ch);
if ('2'==ch)
{
goto exit;
iReturn =3;
}
}
iReturn = 0;
goto exit;
}
else
{
iReturn = 1;
goto exit;
}
exit:
return iReturn ;
}
fgetc读取简单文件的内容
最新推荐文章于 2022-10-01 20:03:19 发布