读取文件不是设想的那样
本帖最后由 大可爱 于 2018-11-15 19:14 编辑#include<stdio.h>
int main()
{
FILE *fp;
char *str1,*str2;
if ((fp = fopen("c://tag.txt","r")) == NULL||fgets (str1,100,fp) == NULL)
{
printf("the file is empty");
return ;
}
puts (str1);
fclose(fp);
}
char *str1; 应该声明为char str;字符串数组吧
页:
[1]