#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//读取文件每行
int main()
{
char c[1000];
FILE *fptr = fopen("/passwd.txt", "r");
while (fgets(c,sizeof(c),fptr) != NULL)
{
printf("%s",c);
}
fclose(fptr);
return 0;
}
C语言读取txt文件的每行
最新推荐文章于 2024-05-04 21:03:09 发布