how to check if a variable is a string in C + + code example
Example: c string is int
int isNumber(char s[])
{
for (int i = 0; s[i]!= '\0'; i++)
{
if (isdigit(s[i]) == 0)
return 0;
}
return 1;
}
int isNumber(char s[])
{
for (int i = 0; s[i]!= '\0'; i++)
{
if (isdigit(s[i]) == 0)
return 0;
}
return 1;
}