C ++ iswalpha () - C ++ standardbibliotek

Funksjonen iswalpha () i C ++ sjekker om det gitte brede tegnet er et alfabet eller ikke.

Funksjonen iswalpha () er definert i topptekstfilen.

iswalpha () prototype

 int iswalpha (wint_t ch);

Funksjonen iswalpha () sjekker om ch er et alfabetisk tegn eller ikke. Følgende tegn er klassifisert som alfabet:

  • Store bokstaver: A til Å
  • Små bokstaver: a til z

iswalpha () -parametere

  • ch: Det brede tegnet å sjekke.

iswalpha () Returverdi

  • Funksjonen iswalpha () returnerer ikke null-verdi hvis ch er et alfabetisk tegn.
  • Den returnerer null, hvis ch ikke er et alfabetisk tegn.

Eksempel: Hvordan fungerer iswalpha () -funksjonen?

 #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

Interessante artikler...