是怎么一行一行读取字符串的 当执行第2次 while(fgets(arr,MAX,fp)!=NULL),fgets是怎么变为从txt.txt第2行开始读取的?还是其他情况 [解决办法] char * fgets ( char * str, int num, FILE * stream ); Get string from stream
Reads characters from stream and stores them as a C string into str until (num-1) characters have been read or either a newline or a the End-of-File is reached, whichever comes first. A newline character makes fgets stop reading, but it is considered a valid character and therefore it is included in the string copied to str. A null character is automatically appended in str after the characters read to signal the end of the C string.