De functie iswalpha () in C ++ controleert of het opgegeven brede teken een alfabet is of niet.
De functie iswalpha () is gedefinieerd in het header-bestand.
iswalpha () prototype
int iswalpha (wint_t ch);
De functie iswalpha () controleert of ch een alfabetisch teken is of niet. De volgende karakters zijn geclassificeerd als alfabetten:
- Hoofdletters: A tot Z
- Kleine letters: a tot z
iswalpha () Parameters
- ch: het brede teken dat moet worden gecontroleerd.
iswalpha () Retourwaarde
- De functie iswalpha () retourneert een waarde die niet nul is als ch een alfabetisch teken is.
- Het geeft nul terug als ch geen alfabetisch teken is.
Voorbeeld: hoe werkt de functie iswalpha ()?
#include #include #include #include using namespace std; int main() ( setlocale(LC_ALL, "en_US.UTF-8"); wchar_t str() = L"u221c!$131u2288@"; bool flag = 0; for (int i=0; i
When you run the program, the output will be:
∜!$131⊈@ doesn't contain alphabets