stdin 就是标准输入流,上面代码等同于 gets(str);
在C语言中, fgets() 函数 是一个用于从文件或标准输入中读取字符串的常用函数,当我们在 fgets() 函数中使用 stdin 时,它表示我们希望从标准输入(通常是键盘)读取数据。 stdin 是C语
`fgets'--get character string from a file or stream 从文件或者流中获取字符串 stdin是标准输入流 示例1:char strBuf[1024];fgets(strBuf, sizeof(strBuf), stdin);//处理strBuf示例2:FILE* fp = fopen("some_file.txt", "r");if(fp){ char strBuf[1024]; fgets(strBuf, ...
The fgets function returns s if successful. If end-of-file is encountered and no characters have been read into the array, the contents of the array remain unchanged and a null pointer is returned. If a read error occurs during the operation, the array contents are indeterminate and a null...