다음을 통해 공유


toupper

문자를 대문자로 변환합니다.

template<Class CharType>
   CharType toupper(
      CharType _Ch, 
      const locale& _Loc
   )

매개 변수

  • _Ch
    대문자로 변환할 문자입니다.

  • _Loc
    변환할 문자를 포함 하는 로캘.

반환 값

문자를 대문자로 변환 합니다.

설명

템플릿 함수가 반환 use_facet<ctype<CharType> >(_Loc).toupper(_Ch).

예제

// locale_toupper.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
using namespace std;

int main( )   
{
   locale loc ( "German_Germany" );
   char result1 = toupper ( 'h', loc );
   cout << "The upper case of 'h' in the locale is: "
        << result1 << "." << endl;
   char result2 = toupper ( 'H', loc );
   cout << "The upper case of 'H' in the locale is: "
        << result2 << "." << endl;
   char result3 = toupper ( '$', loc );
   cout << "The upper case of '$' in the locale is: "
        << result3 << "." << endl;
}

Output

The upper case of 'h' in the locale is: H.
The upper case of 'H' in the locale is: H.
The upper case of '$' in the locale is: $.

요구 사항

헤더: <locale>

네임 스페이스: std