The semantics of fopen require a complementary fclose.
fopen的语义需要补充性的fclose。
The fgets, fgetss, fread, fscanf, and fclose functions also return False on error.
fscanf和fclose 函数在出错时也返回False。
Of course, with the exception of fclose, you are likely already processing the return values on these.
当然,除fclose 以外,您可能已经对这些函数的返回值都进行了处理。
Skipping ahead to the end of Listing 1, fclose serves the opposite function of fopen: it closes the connection to the file or URL.
向前跳至清单1的末尾,fclose将实现与fopen相反的功能:它将关闭指向文件或URL的连接。
It shows appropriate use of some system calls and library functions from c, including fopen, fclose, access, setvbuf, perror, strerror, and popen.
它演示了对一些系统调用和c库函数的适当使用,其中包括fopen、fclose、access、setvbuf、perror、strerror和popen。
With fclose, there is little to do if the file handle does not close properly, so checking the return value for fclose is generally unnecessary.
使用fclose时,即使文件处理未正常关闭,也不会执行什么操作,因此通常不必检查fclose的返回值。
For any of these methods, you go through the standard process of using fopen to open the file, a function to read the data, then fclose to close the file, as shown in Listing 1.
对于这些方法中的任何一种,通过使用fopen(用于读取数据的函数)的标准方法打开文件,然后使用fclose关闭文件,如清单1所示。
It is needed for the file opening, closing, reading, and writing functions (fopen , fclose , fgets , getc , and so on), for the printf family of functions, and for the setvbuf function.
文件的打开、关闭、读和写函数(fopen 、fclose 、fgets 、getc等等)、printf函数系列和setvbuf函数都需要它。
It is needed for the file opening, closing, reading, and writing functions (fopen , fclose , fgets , getc , and so on), for the printf family of functions, and for the setvbuf function.
文件的打开、关闭、读和写函数(fopen 、fclose 、fgets 、getc等等)、printf函数系列和setvbuf函数都需要它。
应用推荐