fgets字符串形式读取文件(待定)

#include<stdio.h>
void main()
{
FILE*fp;//文件指针
char ch[200];
char *c;
fp=fopen(“hello.txt”,“rt”);
if(fpNULL)
{
puts(“文件不存在”);
}
else
{
while(1)
{
c=fgets(ch,50,fp);
if(c
NULL)
{
break;
}
puts(ch);
}

}

}

猜你喜欢

转载自blog.csdn.net/weixin_44262430/article/details/88615982