#include #include #include int main(){ char a[100][100]; int i=0; FILE* fp; if((fp=fopen("c:\\data.txt","r"))==0) { printf("无文件!!\n"); return -1; } { fscanf(fp,"%s",a[i]); while(!feof(fp)) printf("%s\n",a[i]); i++; } fclose(fp); return 0;}
思路差不多就这样吧,要是跑不了自己改改吧