A função iswdigit () em C ++ verifica se o caractere largo fornecido é um dígito ou não.
A função iswdigit () é definida no arquivo de cabeçalho.
protótipo iswdigit ()
int iswdigit (wint_t ch);
A função iswalnum () verifica se ch é um dígito ou não. Os caracteres de 0 a 9, ou seja, 0,1,2,3,4,5,6,7,8,9 são classificados como dígitos.
Parâmetros iswdigit ()
- ch: O caractere largo a ser verificado.
iswdigit () Valor de retorno
- A função iswdigit () retorna um valor diferente de zero se ch for um dígito. Caso contrário, retorna zero.
- Ele retorna zero se ch não for um dígito.
Exemplo: Como funciona a função iswdigit ()?
#include #include #include #include using namespace std; int main() ( setlocale(LC_ALL, "en_US.UTF-8"); wchar_t str() = L"u20b9u0967u0966 = Rs.10"; wcout << L"The digit in the string "" << str << L" " are :" << endl; for (int i=0; i
When you run the program, the output will be:
The digit in the string "₹१० = Rs.10" are : 1 0