std::isalnum - cppreference.com
Espaços nominais
Variantes
Ações

std::isalnum

De cppreference.com

<metanoindex/>

 
 
Biblioteca cordas
Strings terminadas
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cadeias de bytes
Multibyte cordas
Cordas de largura
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Cordas de terminação nula de bytes
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação personagem
Original:
Character manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Conversões para formatos numéricos
Original:
Conversions to numeric formats
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação de cadeia
Original:
String manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Exame String
Original:
String examination
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação de memória
Original:
Memory manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Diversos
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
<tbody> </tbody>
Definido no cabeçalho <cctype>
int isalnum( int ch );
Verifica se o caráter dado é um caractere alfanumérico de acordo com a localidade C atual, ou seja, quer um número (0123456789 no local padrão), uma letra maiúscula (ABCDEFGHIJKLMNOPQRSTUVWXYZ no local padrão), ou uma letra minúscula (abcdefghijklmnopqrstuvwxyz no local padrão).
Original:
Checks if the given character is an alphanumeric character according to the current C locale, i.e. either a number (0123456789 in the default locale), an uppercase letter (ABCDEFGHIJKLMNOPQRSTUVWXYZ in the default locale), or a lowercase letter (abcdefghijklmnopqrstuvwxyz in the default locale).
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 -
personagem
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 diferente de zero (true) se o personagem é um caractere alfanumérico, 0 (false) de outra forma.
Original:
Non-zero value (true) if the character is an alphanumeric 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.

Exemplo

Demonstra o uso de isalnum () com diferentes localidades (OS-específica) .
Original:
Demonstrates the use of isalnum() with different locales (OS-specific).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <iostream>
#include <cctype>
#include <clocale>

int main()
{
    const char c = '\xdf'; // German letter ß in ISO-8859-1

    std::cout << "isalnum(\'\\xdf\', default C locale) returned "
               << std::boolalpha << (bool)std::isalnum(c) << '\n';

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

}

Saída:

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

Veja também

checa se o caractere é classificado como alfanumérico pela localização
Original:
checks if a character is classified as alphanumeric by a locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de função) [edit]
verifica se um caractere largo é alfanumérico
Original:
checks if a wide character is alphanumeric
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
Documentação C para isalnum