char *gets(char *s)
gets reads the next input line into the array s; it replaces the terminating newline with '\0'. It returns s, or NULL if end of file or error occurs.
那输入空行……
[/Quote]
If the End-of-File is encountered and no characters have been read, the contents of str remain unchanged and a null pointer is returned.
对, 空行会返回NULL
char *gets(char *s)
gets reads the next input line into the array s; it replaces the terminating newline with '\0'. It returns s, or NULL if end of file or error occurs.
那输入空……
[/Quote]
不会,只有遇到文件结尾或者发送错误时
char *gets(char *s)
gets reads the next input line into the array s; it replaces the terminating newline with '\0'. It returns s, or NULL if end of file or error occurs.
[/Quote]那输入空行是否返回空指针?
char *gets(char *s)
gets reads the next input line into the array s; it replaces the terminating newline with '\0'. It returns s, or NULL if end of file or error occurs.