dec

정수 변수 10 기본 표기법으로 표시 되도록 지정 합니다.

ios_base& dec(
   ios_base& _Str
);

매개 변수

  • _Str
    참조 형식의 개체를 ios_base, 상속 형식 또는 ios_base.

반환 값

개체의 참조는 _Str 파생 됩니다.

설명

기본적으로 정수 변수는 10 진수 표시 됩니다.

dec effectively calls _Str.setf(ios_base::dec, ios_base::basefield), and then returns _Str.

예제

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

int main( ) 
{
   using namespace std;
   int i = 100;

   cout << i << endl;   // Default is base 10
   cout << hex << i << endl;   
   dec( cout );
   cout << i << endl;
   oct( cout );
   cout << i << endl;
   cout << dec << i << endl;
}
  

요구 사항

헤더: <ios>

네임 스페이스: std

참고 항목

참조

iostream 프로그래밍

iostreams 규칙