basic_ios::fill
テキストがストリームほど広範に使用された文字を返します。
char_type fill( ) const;
char_type fill(
char_type _Char
);
パラメーター
- _Char
は、塗りつぶし文字にする文字。
戻り値
現在の Fill 文字。
解説
一つ目のメンバー関数は、格納されている Fill 文字を返します。 2 つ目のメンバー関数は、塗りつぶし文字で _Char を保存し、前に格納されている値を返します。
使用例
// basic_ios_fill.cpp
// compile with: /EHsc
#include <iostream>
#include <iomanip>
int main( )
{
using namespace std;
cout << setw( 5 ) << 'a' << endl;
cout.fill( 'x' );
cout << setw( 5 ) << 'a' << endl;
cout << cout.fill( ) << endl;
}
必要条件
ヘッダー: <ios>
名前空間: std