"
With fgets, we have to specify the size of the buffer, n.
This function reads up through and including the next newline, but no more than n-1 charactors, into the buffer.
"
返回的是buffer的首地址。
或者NULL(出错或者文件尾的时候). 需要用feof, ferror来检测具体什么情况。
unix的文本终结符是 /n 10
win的文本终结符是 /r 13 /n 10
这些符号也会被读到buffer中
"through and including the next newline"
"the next newline"应该就是指 /n (未经证实)
如果以/r(在某些操作系统中)作为行结束,可能就会出现问题。
With fgets, we have to specify the size of the buffer, n.
This function reads up through and including the next newline, but no more than n-1 charactors, into the buffer.
"
返回的是buffer的首地址。
或者NULL(出错或者文件尾的时候). 需要用feof, ferror来检测具体什么情况。
unix的文本终结符是 /n 10
win的文本终结符是 /r 13 /n 10
这些符号也会被读到buffer中
"through and including the next newline"
"the next newline"应该就是指 /n (未经证实)
如果以/r(在某些操作系统中)作为行结束,可能就会出现问题。