La fonction isdigit () en C ++ vérifie si le caractère donné est un chiffre ou non.
Prototype isdigit ()
int isdigit (int ch);
La isdigit()fonction vérifie si ch est un chiffre ou non, c'est-à-dire un de 0,1,2,3,4,5,6,7,8 et 9.
Le comportement de isdigit()n'est pas défini si la valeur de ch n'est pas représentable en tant que caractère non signé ou n'est pas égale à EOF.
Il est défini dans le fichier d'en-tête "> fichier d'en-tête.
Paramètres isdigit ()
ch: Le caractère à vérifier.
isdigit () Valeur de retour
La isdigit()fonction renvoie une valeur non nulle si ch est un chiffre, sinon renvoie zéro.
Exemple: comment fonctionne la fonction isdigit ()
#include #include #include using namespace std; int main() ( char str() = "hj;pq910js4"; cout << "The digit in the string are:" << endl; for (int i=0; i
When you run the program, the output will be:
The digit in the string are: 9 1 0 4








