std::fwrite
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <cstdio> 中定义
|
||
int fwrite( const void* buffer, std::size_t size, std::size_t count, std::FILE* stream ); |
||
Writes up to count
objects from the given array buffer
to the output stream stream
as if by reinterepreting each object as an array of unsigned char and calling std::fputc size
times for each object to write those unsigned chars into stream
, in order. The file position indicator for the stream is advanced by the number of characters written.
如果对象是不
TriviallyCopyable
,该行为是未定义.原文:
If the objects are not
TriviallyCopyable
, the behavior is undefined.如果发生错误,产生的值的流的文件位置指示器
原文:
If an error occurs, the resulting value of the file position indicator for the stream is
indeterminate.
目录 |
[编辑] 参数
buffer | - | 要写入数组中的第一个对象的对象的指针
原文: pointer to the first object object in the array to be written |
size | - | 每个对象的大小
|
count | - | 要写入的对象的数量
原文: the number of the objects to be written |
[编辑] 返回值
Number of objects written successfully, which may be less than count
if an error occurred.
如果
size
count
是零,fwrite
返回零,并执行任何其他操作.原文:
If
size
or count
is zero, fwrite
returns zero and performs no other action.[编辑] 示例
本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
(C++11) |
打印格式化输出到stdout,文件流或缓冲区 原文: prints formatted output to stdout, a file stream or a buffer (函数) |
将一个字符串写入一个文件流 原文: writes a character string to a file stream (函数) | |
从文件读取 (函数) | |
C documentation for fwrite
|