Share via


isxdigit

ロケールの要素が 16 進数を表すために使用される文字かどうかをテストします。

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

パラメーター

  • _Ch
    テストする要素。

  • _Loc
    テストされる要素を含むロケール。

戻り値

テストされる要素が 16 進数を表すために使用される文字の場合true ; ある false

解説

このテンプレート関数は use_facet<ctype< CharType>> を返します (_Loc)。です。 (ctype<CharTypeの >::xdigit、_Ch)。

0 ~ 15 を表す 0 ~ 9 の正、大文字と小文字が A ~ F を使用して数値を表す、16 進数の使用条件 16。

使用例

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

出力

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