char to int

hi guys
is there a function for convert char to int???
for example '1' to 1
thanks a lot
Single chars are really simple: int theNumber = int('1' - '0');. I have never used it, but I have seen it being posted here several times.
A character itself is a number.
1
2
char c = 'X';
int i = c; // will work fine, i will have the ASCII ( or whatever encoding you are using ) code for 'X'  
thank you very much
Topic archived. No new replies allowed.