Linux 函数--fwrite
来源:互联网 发布:知乎一小时 编辑:程序博客网 时间:2024/06/06 19:24
功 能: 写内容到流中
用 法:fwrite(buffer,size,count,fp);
(1)buffer:是一个指针,对fwrite来说,是要输出数据的地址。
(2)size:要写入的字节数;
(3)count:要进行写入size字节的数据项的个数;
(4)fp:目标文件指针。
程序例:
#include <stdio.h>
struct mystruct
{
int i;
char ch;
};
int main(void)
{
FILE *stream;
struct mystruct s;
if ((stream = fopen("TEST.$$$", "wb")) == NULL) /* open file TEST.$$$ */
{
fprintf(stderr, "Cannot open output file./n");
return 1;
}
s.i = 0;
s.ch = 'A';
fwrite(&s, sizeof(s), 1, stream); /* write struct s to file */
fclose(stream); /* close file */
return 0;
}
- Linux 函数--fwrite
- linux fopen fread fwrite函数分析
- fwrite () 函数
- fwrite 函数
- fwrite函数
- fread函数 & fwrite函数
- linux-0.11调试教程,fwrite ()函数的作用
- fread() fwrite() 函数简介
- fread() fwrite() 函数简介
- fread 、fwrite 函数
- fread与fwrite函数
- fwrite--C语言函数
- fwrite函数中换行
- ******************** fwrite--fread 函数 ********************
- fwrite函数的用法
- fwrite 和 fread函数
- fread和fwrite函数
- fwrite函数的简介
- 如何解决ubuntu下pdf乱码的问题
- C#实现字符串转换到16进制byte类型
- shared_ptr源码解读
- 第一学习的是VS2005快捷键
- Oracle性能优化经验分享之系统参数设置
- Linux 函数--fwrite
- 在Windchill中編寫rbInfo類型的資源文件,編譯過后:報在資源文件中找不到相應的Key
- Silverlight 教程第二部分:使用布局管理
- GIRDVIEWD的一些小技巧
- java面试题
- 桌面托盘程序
- 关于常见排序算法的稳定性分析和结论
- SQL Server2000日期时间的处理
- PKU1737 解题报告 Connected Graph __高精度加法,乘法,减法,组合数