Answers for "numerical value of char in c"

C
1

char to int in c

strcpy(str, "98993489");
   val = atoi(str);
   printf("String value = %s, Int value = %dn", str, val);
Posted by: Guest on February-19-2021
-2

c check if char is number

char c = 'a'; // or whatever

if (isalpha(c)) {
    puts("it's a letter");
} else if (isdigit(c)) {
    puts("it's a digit");
} else {
    puts("something else?");
}
Posted by: Guest on June-09-2020

Code answers related to "C"

Browse Popular Code Answers by Language