c语言i––是什么
Output
It will display the content of file demo.txt.
Explanation
I have opened the file demo.txt in read mode. Now I am reading the strings from the file using fgets() function. As you can see I have used ‘n’, it means fgets() will read a string till new line is encountered. When fgets() can’t find anymore string then it will return NULL and this will be the end of file.
You can find more C programs on file handling here.
Output
It will display the content of file demo.txt.
Explanation
I have opened the file demo.txt in read mode. Now I am reading the strings from the file using fgets() function. As you can see I have used ‘n’, it means fgets() will read a string till new line is encountered. When fgets() can’t find anymore string then it will return NULL and this will be the end of file.
You can find more C programs on file handling here.
翻译自: https://www.thecrazyprogrammer.com/2015/02/file-handling-in-c-part-4.html
c语言i––是什么