Convert char to int (not ASCII)

I want to convert a char to an int.

e.g.

char theChar '9';
int theInt = theChar;

would this be the way to do it, i heard its only for 0 to 9, so how would i do it for an interger like 365??

Last edited on
i don't get it.
if you want to transform a char to an int, simply put:
1
2
3
char c='9';
int i;
i=c;

if you want to transform a digit into a number, use this:
 
i=c-'0';
k thanks
Topic archived. No new replies allowed.