+ 2
How we convert character into integer?????
4 Answers
+ 6
If you need the ASCII value,
char ch = 'd';
int a = ch; // int a = (int) ch is redundant.
To convert the character into integer (eg. '1' to 1),
char ch = '1';
int c = ch - '0';
+ 1
char c = 'a';
int x = (int)c;
+ 1
it's really work or not?
+ 1
char a ;
cout << int (a);