C ++ iswprint () - C ++ Standardbibliotek

Funktionen iswprint () i C ++ kontrollerer, om det givne brede tegn kan udskrives eller ej.

Funktionen iswprint () er defineret i headerfilen.

iswprint () prototype

 int iswprint (wint_t ch);

Funktionen iswprint () kontrollerer, om ch kan udskrives eller ikke. Følgende tegn kan som standard udskrives:

  • Cifre (0 til 9)
  • Store bogstaver (A til Z)
  • Små bogstaver (a til z)
  • Tegnsætningstegn (! "# $% & '() * +, -. /:;? @ () _` (|) ~)
  • Plads

iswprint () Parametre

  • ch: Den brede karakter, der skal kontrolleres.

iswprint () Returværdi

  • Funktionen iswprint () returnerer værdien ikke nul, hvis ch kan udskrives.
  • Det returnerer nul, hvis ch ikke kan udskrives.

Eksempel: Hvordan fungerer iswprint () -funktionen?

 #include #include #include #include using namespace std; int main() ( setlocale(LC_ALL, "en_US.UTF-8"); wchar_t str() = L"Ĥĕllö ĂllĦow are ŷou"; for (int i=0; i 

When you run the program, the output will be:

 Ĥĕllö Ăll Ħow are ŷou

Here, and are non-printable characters in the string.

Interessante artikler...