#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(cNULL)
{
break;
}
puts(ch);
}
}
}
#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(cNULL)
{
break;
}
puts(ch);
}
}
}