std::basic_ostream::write
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| 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
countcharacters are inserted - inserting into the output sequence fails (in which case setstate(badbit) is called)
sentry, который очищает tie()'d выходные буферы при необходимости и проверяет поток ошибок. После завершения строительных работ, если часовой объект возвращается false, функция возвращает не пытаясь никаких выходных данных. Если исключение во время выходных, то IOS :: badbit установлен (за исключением подавляется, если exceptions()&badbit != 0, в этом случае он выдается повторно)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)You can help to correct and verify the translation. Click here for instructions.
Содержание |
[править] Параметры
| s | - | pointer to the character string to write |
| count | - | number of characters to write |
[править] Возвращаемое значение
*this
[править] Notes
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click here for instructions.
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
[править] См. также
| вставками символьных данных Original: inserts character data The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) | |
| вставками характер Original: inserts a character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (public функция-член) | |