int a = 10, b = 11, c = 12, d = 13, e = 14, f = 15;
int n = 0;
int num;
string h;
cout << "Enter a number:\n";
cin >> h
for(int i = h.length(); i > 0; i--){
num = num + (h[i-1] * pow(16, (h.length()-1-i)));
}
I'm trying to do a string to hexadecimal conversion. When the user inputs "aa", the output integer should be 176, but I have no idea how to get 'a' to equal 10 while in the loop.