C语言的函数

来源:互联网 发布:excel 删除重复数据 编辑:程序博客网 时间:2024/05/16 08:41

一,fgets函数的使用

char *fgets(char *s, int size, FILE *stream);

说明:

fgets()  reads  in at most one less than size characters from       stream and stores them into  the  buffer  pointed  to  by  s.       Reading  stops  after  an  EOF or a newline.  If a newline is       read, it is stored into the buffer.  A terminating null  byte       ('\0') is stored after the last character in the buffer.

fgets函数是以\n\0结束的 使用在使用的要注意