isxdigit

Comprueba si un elemento en una configuración regional es un carácter utilizado para representar un número hexadecimal.

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

Parámetros

  • _Ch
    El elemento que se va a probar.

  • _Loc
    Configuración regional que contiene el elemento que se va a probar.

Valor devuelto

true si el elemento probado es un carácter utilizado para representar un número hexadecimal; false si no es.

Comentarios

La función de la plantilla devuelve use_facet<C< CharType> >(_Loc).es(::<xdigit>, _ChdectypeCharType).

Base 16 de los dígitos hexadecimales para representar números, utilizando las letras sin distinción entre mayúsculas y minúsculas más A de los números 0 a 9 con f para representar números decimales 0 a 15.

Ejemplo

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

Resultados

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.

Requisitos

configuración regional <deEncabezado: >

Espacio de nombres: std