Check out example codes for "c++ check if char is number". It will help you in understanding the concepts better.

Code Example 1

char c = '1';
bool result = isdigit(c);
cout << result << endl; //1

Code Example 2

#include<stdio.h>
#include<ctype.h>

int main() {
   char val1 = 's';
   char val2 = '8';

   if(isdigit(val1))
   printf("The character is a digit\n");
   else
   printf("The character is not a digit\n");

   if(isdigit(val2))
   printf("The character is a digit\n");
   else
   printf("The character is not a digit");

   return 0;
}

Learn ReactJs, React Native from akashmittal.com