次の方法で共有


basic_ostream::flush

バッファーをフラッシュします。

basic_ostream<_Elem, _Tr>& flush( );

戻り値

basic_ostream のオブジェクトへの参照。

解説

rdbuf が null ポインターの場合、関数呼び出し rdbuf->pubsync。この -1 を返す場合、関数呼び出し setstate (badbit)。これは *thisを返します。

使用例

// basic_ostream_flush.cpp
// compile with: /EHsc
#include <iostream>

int main( ) 
{
   using namespace std;
   cout << "test";
   cout.flush();
}
  

必要条件

ヘッダー: <ostream>

名前空間: std

参照

関連項目

basic_ostream Class

入出力ストリームのプログラミング

入出力ストリームの規則