My code is this:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main() {
int a;
cout << "Enter a number" << endl;
cin >> a;
string a_str;
ostringstream temp;
temp << a;
a_str = temp.str();
for(int i = 0; i < a_str.length(); i++) {
char c = a_str[i]; //How this character convert to integer number
}
system("pause");
return EXIT_SUCCESS;
}
How char c
convert to int
?
I need this for
I need this because I need to get the highest digit