std::iscntrl
De cppreference.com
<metanoindex/>
<tbody> </tbody>| Definido no cabeçalho <cctype>
|
||
int iscntrl( int ch ); |
||
Verifica se o caráter dado é classificado como um caractere de controle pela localidade C instalado atualmente. No local padrão C, os caracteres de controle são os personagens com os códigos de
0x00-0x1F e 0x7F.Original:
Checks if the given character is classified as a control character by the currently installed C locale. In the default C locale, the control characters are the characters with the codes
0x00-0x1F and 0x7F.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
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 de controle, 0 (false) de outra forma.Original:
Non-zero value (
true) if the character is a control 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.
You can help to correct and verify the translation. Click here for instructions.
Exemplo
#include <iostream>
#include <cctype>
#include <clocale>
int main()
{
char c = '\x94'; // the control code CCH in ISO-8859-1
std::cout << "iscntrl(\'\\x94\', default C locale) returned "
<< std::boolalpha << (bool)std::iscntrl(c) << '\n';
std::setlocale(LC_ALL, "en_GB.iso88591");
std::cout << "iscntrl(\'\\x94\', ISO-8859-1 locale) returned "
<< std::boolalpha << (bool)std::iscntrl(c) << '\n';
}
Saída:
iscntrl('\x94', default C locale) returned false
iscntrl('\x94', ISO-8859-1 locale) returned true
Veja também
checa se o caractere é classificado como um caractere de controle de uma localidade Original: checks if a character is classified as a control character 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) | |
checa se o personagem de largura é um caractere de controle Original: checks if a wide character is a control character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) | |
Documentação C para iscntrl
| |
