错误地写入了FILE和NULL(C区分大小写).fopen line缺少分号.
下面的代码编译并运行.
#include main(void) { FILE *file = fopen("words.txt","r"); if(file != NULL) { char line[128]; while(fgets( line, sizeof line, file) != NULL) { fputs ( line, stdout ); } fclose ( file ); } }