名前空間
変種
操作

std::basic_ostream::write

提供: cppreference.com
< cpp‎ | io‎ | basic ostream

 
 
入力/出力ライブラリ
I / Oのマニピュレータ
CスタイルのI / O
バッファ
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(廃止予定)
ストリーム
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
抽象化
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
ファイルI / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
文字列I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
アレイのI / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream(廃止予定)
ostrstream(廃止予定)
strstream(廃止予定)
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
エラーカテゴリインターフェース
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category(C++11)
io_errc(C++11)
 
std::basic_ostream
グローバルオブジェクト
Original:
Global objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::basic_ostream
basic_ostream::~basic_ostream
basic_ostream::operator=(C++11)
書式付き入力
Original:
Formatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::operator<<
書式なし入力
Original:
Unformatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::put
basic_ostream::write
ポジショニング
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::tellp
basic_ostream::seekp
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::flush
basic_ostream::swap(C++11)
メンバークラス
Original:
Member classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::sentry
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator<<(std::basic_ostream)
 
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'd出力バッファが必要であれば、型tie()のオブジェクトを作成することにより、実行を開始し、ストリームのエラーをチェックします。建設後、false監視オブジェクトを返した場合、この関数は、任意の出力をしようとせずに返します。例外が出力時にスローされた場合、その後はios :: badbitをは(exceptions()&badbit != 0が、その場合、それがスローされない限り、例外が抑制されている)が設定されます
Original:
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)
The text has been machine-translated via Google Translate.
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

[編集] ノート

違って種類のオーバーロードされていません
Original:
This function is not overloaded for the types signed char or unsigned char, unlike the formatted
The text has been machine-translated via Google Translate.
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

#include <iostream>
int main()
{
    int n = 0x41424344;
    std::cout.write(reinterpret_cast<char*>(&n), sizeof n);
    std::cout << '\n';
}

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.

(機能) [edit]
文字を挿入
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.

(パブリックメンバ関数) [edit]