将字符放到流。
int_type sputc(
char_type _Ch
);
参数
- _Ch
字符。
返回值
返回字符,如果成功,则为。
备注
如果 write position 使用,成员函数编写存储在位置的 _Ch,增大输出缓冲区的指针,并且返回 traits_type::。to_int_type(_Ch)。 否则,返回 (_Ch)。溢出
示例
// basic_streambuf_sputc.cpp
// compile with: /EHsc
#include <iostream>
#include <fstream>
int main( )
{
using namespace std;
int i = cout.rdbuf( )->sputc( 'a' );
cout << endl << ( char )i << endl;
}
要求
页眉: <streambuf>
命名空间: std