99问答网
所有问题
怎样在C中一行一行读取文件的内容?急求解
如题所述
举报该问题
推荐答案 2013-10-28
fgets()函数遇到回车返回,所以适合读一行
函数名: fgets
功 能: 从流中读取一字符串
用 法: char *fgets(char *string, int n, FILE *stream);程序例:
#include <string.h
#include <stdio.h
int main(void){FILE *stream;
char string[] = "This is a test";
char msg[20];
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://99.wendadaohang.com/zd/WOjzOBWeBztXeeevXet.html
相似回答
大家正在搜