c transform string in int 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: c string to int
char s[] = "45";
int num = atoi(s);
atoi(str) is unsafe
This is the prefered method:
(int)strtol(str, (char **)NULL, 10)
char s[] = "45";
int num = atoi(s);