Is there any in built function in C++, which can convert char to int?
Simply assign char value to int type.
int i = 'b';
Or you can also do like below:
char n = '4'; int x = n - '0'; cout << x << endl; x is 4 when printed.
Ask Us