English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Biblioteca Padrão do C - <stdio.h>
C 库函数 int fclose(FILE *stream) 关闭流 stream。刷新所有的缓冲区。下面是 fclose() 函数的声明。
int fclose(FILE *stream)
stream -- 这是指向 FILE 对象的指针,该 FILE 对象指定了要被关闭的流。
如果流成功关闭,则该方法返回零。如果失败,则返回 EOF。
下面的示例演示了 fclose() 函数的用法。
#include <stdio.h> int main() { FILE *fp; fp = fopen("file.txt", "w"); fprintf(fp, "%s", "这里是 www.w")3codebox.com"); fclose(fp); return(0); }
Vamos compilar e executar o programa acima, o que criará um arquivo file.txtEscreva a linha de texto abaixo e, em seguida, use fclose() Fechar o arquivo da função.
Aqui está pt.oldtoolbag.com