std::isalpha - cppreference.com
Espacios de nombres
Variantes

std::isalpha

De cppreference.com
 
 
 
Cadenas de bytes terminadas en nulo
Funciones
Manipulación de caracteres
Conversiones a formatos numéricos
(C++11)(C++11)
(C++11)(C++11)
Manipulación de cadenas
Examinación de cadenas
Manipulación de memoria
Misceláneos
 
Definido en el archivo de encabezado <cctype>
int isalpha( int ch );
Comprueba si el carácter dado es un carácter alfabético de acuerdo con el entorno nacional C instalado actualmente. En la configuración regional predeterminada, esta función devuelve true para las letras y ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz .
Original:
Checks if the given character is an alphabetic character according to the currently installed C locale. In the default locale, this function returns true for the letters ABCDEFGHIJKLMNOPQRSTUVWXYZ and abcdefghijklmnopqrstuvwxyz.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parámetros

ch -
carácter
Original:
character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valor de retorno

Valor distinto de cero (true) si el carácter es un carácter alfabético, 0 (false) de otra manera .
Original:
Non-zero value (true) if the character is an alphabetic character, 0 (false) otherwise.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Ejemplo

#include <iostream>
#include <cctype> 
#include <clocale>
         
int main()
{        
    char c = '\xdf'; // German letter ß in ISO-8859-1
 
    std::cout << "isalpha(\'\\xdf\', default C locale) returned "
               << std::boolalpha << (bool)std::isalpha(c) << '\n';

    std::setlocale(LC_ALL, "de_DE.iso88591");
    std::cout << "isalpha(\'\\xdf\', ISO-8859-1 locale) returned "
              << std::boolalpha << (bool)std::isalpha(c) << '\n';
    
}

Salida:

isalpha('\xdf', default C locale) returned false
isalpha('\xdf', ISO-8859-1 locale) returned true

Ver también

Comprueba si un carácter está clasificado como alfabético por una configuración regional.
(plantilla de función) [editar]
Comprueba si un carácter ancho es alfabético
Original:
checks if a wide character is alphabetic
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función) [editar]
Documentación de C para isalpha