std::basic_ostream::write
来自cppreference.com
< cpp | io | basic ostream
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
basic_ostream& write( const char_type* s, std::streamsize count ); |
||
Outputs characters from successive locations in the character array whose first element is pointed to by s
. Characters are inserted into the output sequence until one of the following occurs:
- exactly
count
characters are inserted - inserting into the output sequence fails (in which case setstate(badbit) is called)
此功能是一个未格式化的输出功能:它开始执行构造一个对象的类型
sentry
,刷新tie()'d的输出缓冲区,如果必要的检查流错误。项目建成后,false如果哨兵对象返回,该函数返回没有尝试任何输出。如果抛出一个异常,然后在输出的ios :: badbit(exceptions()&badbit != 0被抑制,除非,在这种情况下,它被重新抛出异常)原文:
This function is an unformatted output function: it begin execution by constructing an object of type
sentry
, which flushes the tie()'d output buffers if necessary and checks the stream errors. After construction, if the sentry object returns false, the function returns without attempting any output. If an exception is thrown during output, then ios::badbit is set (the exception is suppressed unless exceptions()&badbit != 0, in which case it is rethrown)目录 |
[编辑] 参数
s | - | pointer to the character string to write |
count | - | number of characters to write |
[编辑] 返回值
*this
[编辑] 注释
此功能不超载的类型signed char或unsigned char,不同的是格式化的<div class="t-tr-text">操作符operator <<
原文:
operator<<
这段文字是通过 [http://translate.google.com Google Translate] 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击[http://en.cppreference.com/w/Cppreference:MachineTranslations 这里]。
您可以帮助我们检查、纠正翻译中的错误。详情请点击[http://en.cppreference.com/w/Cppreference:MachineTranslations 这里]。
原文:
This function is not overloaded for the types signed char or unsigned char, unlike the formatted
操作符operator <<</div>
原文:
operator<<
这段文字是通过 [http://translate.google.com Google Translate] 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击[http://en.cppreference.com/w/Cppreference:MachineTranslations 这里]。
您可以帮助我们检查、纠正翻译中的错误。详情请点击[http://en.cppreference.com/w/Cppreference:MachineTranslations 这里]。
Also, unlike the formatted output functions, this function does not set the failbit
on failure.
[编辑] 例外
If an exception occurs during output and exceptions()&badbit != 0, rethrows that exception.
If output fails and exceptions()&badbit != 0, throws ios_base::failure.
[编辑] 示例
This function may be used to output object representations, i.e. binary output
输出:
DCBA
[编辑] 另请参阅
插入字符数据 (函数) | |
插入一个字符 (公共成员函数) |