C ++ iswdigit () - C ++ standaardbibliotheek

De functie iswdigit () in C ++ controleert of het opgegeven brede teken een cijfer is of niet.

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

iswdigit () prototype

 int iswdigit (wint_t ch);

De functie iswalnum () controleert of ch een cijfer is of niet. De karakters van 0 tot 9 dwz 0,1,2,3,4,5,6,7,8,9 worden geclassificeerd als cijfers.

iswdigit () Parameters

  • ch: het brede teken dat moet worden gecontroleerd.

iswdigit () Retourwaarde

  • De functie iswdigit () retourneert een waarde die niet nul is als ch een cijfer is. Anders retourneert nul.
  • Het geeft nul terug als ch geen cijfer is.

Voorbeeld: hoe werkt de functie iswdigit ()?

 #include #include #include #include using namespace std; int main() ( setlocale(LC_ALL, "en_US.UTF-8"); wchar_t str() = L"u20b9u0967u0966 = Rs.10"; wcout << L"The digit in the string "" << str << L" " are :" << endl; for (int i=0; i 

When you run the program, the output will be:

 The digit in the string "₹१० = Rs.10" are : 1 0

Interessante artikelen...