Udostępnij za pośrednictwem


isxdigit

Sprawdza, czy element w ustawieniach regionalnych jest znak używany do reprezentowania liczbę szesnastkową.

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

Parametry

  • _Ch
    Element badane.

  • _Loc
    Ustawienia regionalne, zawierające element badane.

Wartość zwracana

TRUE , jeśli element badane jest znak używany do reprezentowania numer szesnastkowy; FALSE , jeśli nie jest.

Uwagi

Zwraca funkcję szablonu use_facet<ctype< CharType> >(_Loc).is(ctype<CharType>::xdigit, _Ch).

Cyfry szesnastkowe użyć podstawa 16 do reprezentowania liczb, używając liczb od 0 do 9 oraz liter litery od a do F, aby reprezentować dziesiętny liczby 0 do 15.

Przykład

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

Dane wyjściowe

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.

Wymagania

Nagłówek: <locale>

Obszar nazw: std