C ++ iswprint () - C ++ Standardbibliotek

Funktionen iswprint () i C ++ kontrollerar om det angivna breda tecknet kan skrivas ut eller inte.

Funktionen iswprint () definieras i rubrikfilen.

prototyp iswprint ()

 int iswprint (wint_t ch);

Funktionen iswprint () kontrollerar om ch kan skrivas ut eller inte. Som standard kan följande tecken skrivas ut:

  • Siffror (0 till 9)
  • Versaler (A till Z)
  • Små bokstäver (a till z)
  • Punktstecken (! "# $% & '() * +, -. /:;? @ () _` (|) ~)
  • Plats

iswprint () Parametrar

  • ch: Den breda karaktären att kontrollera.

iswprint () Returvärde

  • Funktionen iswprint () returnerar ett värde som inte är noll om ch kan skrivas ut.
  • Den returnerar noll om ch inte kan skrivas ut.

Exempel: Hur fungerar funktionen iswprint ()?

 #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.

Intressanta artiklar...