다음을 통해 공유


basic_ostream::flush

Flushes the buffer.

basic_ostream<_Elem, _Tr>& flush( );

Return Value

A reference to the basic_ostream object.

Remarks

If rdbuf is not a null pointer, the function calls rdbuf->pubsync. If that returns -1, the function calls setstate(badbit). It returns *this.

Example

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

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

test

Requirements

Header: <ostream>

Namespace: std

See Also

Concepts

basic_ostream Class

basic_ostream Members

iostream Programming

iostreams Conventions