C ++ iswspace () - C ++ standaardbibliotheek

De functie iswspace () in C ++ controleert of het gegeven brede teken een breed witruimteteken is of niet.

De functie iswspace () is gedefinieerd in het header-bestand.

iswspace () prototype

 int iswspace (wint_t ch);

De functie iswspace () controleert of ch een witruimteteken is of niet. Standaard zijn de volgende tekens witruimtetekens:

  • spatie (0x20, ``)
  • form feed (0x0c, ' f')
  • regelinvoer (0x0a, ' n')
  • regelterugloop (0x0d, ' r')
  • horizontaal tabblad (0x09, ' t')
  • verticaal tabblad (0x0b, ' v')

iswspace () Parameters

  • ch: het brede teken dat moet worden gecontroleerd.

iswspace () Retourwaarde

  • De functie iswspace () retourneert een waarde die niet nul is als ch een witruimteteken is.
  • Het geeft nul terug als ch geen witruimteteken is.

Voorbeeld: hoe werkt de functie iswspace ()?

 #include #include #include #include using namespace std; int main() ( setlocale(LC_ALL, "en_US.UTF-8"); wchar_t str() = L" u0939u0947u0932u094b"; wcout << L"Before removing whitespace characters" << endl; wcout << str << endl << endl; wcout << L"After removing whitespace characters" << endl; for (int i=0; i 

When you run the program, the output will be:

 Before removing whitespace characters हेलो After removing whitespace characters हेलो

Interessante artikelen...