edit_note帖子
477
stars积分
406,560
event加入
2012-05-02
怀旧国机
函数名: fclose
schedule发表于 2012-12-02 17:09:00
visibility查看 177
chat_bubble回复 0
#1 楼主
功 能: 关闭一个流
用 法: int fclose(FILE *stream);
程序例:
#include <string.h>
#include <stdio.h>
int main(void)
{
FILE *fp;
char buf[11] = “0123456789“;
/* cre ate a file containing 10 bytes */
fp = fopen(“DUMMY.FIL“, “w“);
fwrite(&buf, strlen(buf), 1, fp);
/* close the file */
fclose(fp);
return 0;
}
用 法: int fclose(FILE *stream);
程序例:
#include <string.h>
#include <stdio.h>
int main(void)
{
FILE *fp;
char buf[11] = “0123456789“;
/* cre ate a file containing 10 bytes */
fp = fopen(“DUMMY.FIL“, “w“);
fwrite(&buf, strlen(buf), 1, fp);
/* close the file */
fclose(fp);
return 0;
}
forum
暂无回复,快来抢沙发!
登录 后才能回复
flag举报帖子