다음을 통해 공유


isxdigit

요소는 로케일에서 16 진수를 나타내는 데 사용 되는 문자가 같은지 테스트 합니다.

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

매개 변수

  • _Ch
    테스트 요소입니다.

  • _Loc
    테스트 하는 요소를 포함 하는 로캘.

반환 값

true 이면 테스트 요소를 16 진수 숫자로 나타내는 데 사용 되는 문자가 있는 경우 false 이면 되지 않은 경우.

설명

템플릿 함수가 반환 use_facet<ctype< CharType> >(_Loc).is(ctype<CharType>::xdigit, _Ch).

숫자 0-9 사용 하 여 숫자를 나타내는 데 기본 16 진수를 사용 뿐만 아니라 대/소문자 구분 문자 A-F는 10 진수를 나타내는 0부터 15 번호.

예제

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

using namespace std;

int main( )   
{
   locale loc ( "German_Germany" );
   bool result1 = isxdigit ( '5', loc );
   bool result2 = isxdigit ( 'd', loc );
   bool result3 = isxdigit ( 'q', loc );

   if ( result1 )
      cout << "The character '5' in the locale is "
           << "a hexidecimal digit-character." << endl;
   else
      cout << "The character '5' in the locale is "
           << " not a hexidecimal digit-character." << endl;

   if ( result2 )
      cout << "The character 'd' in the locale is "
           << "a hexidecimal digit-character." << endl;
   else
      cout << "The character 'd' in the locale is "
           << " not a hexidecimal digit-character." << endl;

   if ( result3 )
      cout << "The character 'q' in the locale is "
           << "a hexidecimal digit-character." << endl;
   else
      cout << "The character 'q' in the locale is "
           << " not a hexidecimal digit-character." << endl;
}

Output

The character '5' in the locale is a hexidecimal digit-character.
The character 'd' in the locale is a hexidecimal digit-character.
The character 'q' in the locale is  not a hexidecimal digit-character.

요구 사항

헤더: <locale>

네임 스페이스: std