I tried the atoi function but it keeps going until it's not an int.
for example
would give me 12, but I need one.Code:char s[5] = "12a12";
int p=atoi(&s[0]);
Printable View
I tried the atoi function but it keeps going until it's not an int.
for example
would give me 12, but I need one.Code:char s[5] = "12a12";
int p=atoi(&s[0]);
s[0] - '0' will give the int value for characters in the range '0' - '9'
thnkx