Aracılığıyla paylaş


isxdigit

Onaltılık tabandaki bir sayıyı temsil etmek için kullanılan bir karakter bir yerel ayar öğesi olup olmadýðýný sýnar.

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

Parametreler

  • _Ch
    Test edilecek olan öğe.

  • _Loc
    Test edilecek öğeyi içeren yerel ayarı.

Dönüş Değeri

gerçek ; onaltılık tabandaki bir sayıyı temsil etmek için kullanılan bir karakter Sınanan öğe ise, yanlış değilse.

Notlar

Şablon işlevini verir use_facet<ctype< CharType> >(_Loc).is(ctype<CharType>::xdigit, _Ch).

0 İle 9 arasındaki sayılar kullanılarak sayýlarý ifade etmek için temel 16 onaltılı basamak kullanmak ayrıca büyük küçük harf duyarsız harfler a ile f ondalık temsil etmek için 0 ile 15 sayı.

Örnek

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

Çıktı

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.

Gereksinimler

Başlık: <locale>

Namespace: std