다음을 통해 공유


basic_ios::fill

Specifies or returns the character that will be used when the text is not as wide as the stream.

char_type fill( ) const; 
char_type fill( 
   char_type _Char 
);

매개 변수

  • _Char
    The character you want as the fill character.

반환 값

The current fill character.

설명

The first member function returns the stored fill character. The second member function stores _Char in the fill character and returns its previous stored value.

예제

// 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;
}
  

요구 사항

Header: <ios>

네임스페이스: std

참고 항목

참조

basic_ios 클래스

iostream 프로그래밍

iostreams 규칙