how to convert a numeric character to int in C code example
Example 1: string to int c
atoi(str) is unsafe
This is the prefered method:
(int)strtol(str, (char **)NULL, 10)
Example 2: turn a char into an int in c
int x = character - '0';
atoi(str) is unsafe
This is the prefered method:
(int)strtol(str, (char **)NULL, 10)
int x = character - '0';