I/O manipulators | ||||
Print functions(C++23) | ||||
C-style I/O | ||||
Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
Streams | ||||
Abstractions | ||||
File I/O | ||||
String I/O | ||||
Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
Synchronized Output | ||||
(C++20) | ||||
Types | ||||
Error category interface | ||||
(C++11) | ||||
(C++11) |
Global objects | ||||
Member functions | ||||
(C++11) | ||||
Formatted output | ||||
Unformatted output | ||||
basic_ostream::write | ||||
Positioning | ||||
Miscellaneous | ||||
(C++11) | ||||
Member classes | ||||
Non-member functions | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
basic_ostream& write(const char_type* s,std::streamsize count); | ||
Behaves as anUnformattedOutputFunction. After constructing and checking the sentry object, outputs the characters from successive locations in the character array whose first element is pointed to bys. Characters are inserted into the output sequence until one of the following occurs:
Contents |
s | - | pointer to the character string to write |
count | - | number of characters to write |
*this
If an internal operation throws an exception, it is caught andbadbit is set. Ifexceptions() is set forbadbit
, the exception is rethrown.
This function is not overloaded for the typessignedchar orunsignedchar, unlike the formattedoperator<<.
Also, unlike the formatted output functions, this function does not set thefailbit on failure.
When using a non-converting locale (the default locale is non-converting), the overrider of this function instd::basic_ofstream may be optimized for zero-copy bulk I/O (by means of overridingstd::streambuf::xsputn).
This function may be used to output object representations, i.e. binary output
Possible output:
DCBAThis!
inserts character data or insert into rvalue stream (function template)[edit] | |
inserts a character (public member function)[edit] |