C 读文件 Windows 与 Linux 的差别
main.c#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *args[])
{
FILE *p1 = fopen("main.c","r");
char buf = {0};
while(!feof(p1))
{
fgets(buf,sizeof(buf),p1);
printf("%s",buf);
}
fclose(p1);
return 0;
}
// hello world
页:
[1]