I need to convert an ASCII string like... "hello2" into it's decimal and or hexadecimal representation (a numeric form, the specific kind is irrelevant). So, "hello" would be : 68 65 6c 6c 6f 32 in HEX. How do I do this in C++ without just using a giant if statement?
EDIT: Okay so this is the solution I went with:
int main()
{
string c = "B";
char *cs = new char[c.size() + 1];
std::strcpy ( cs, c.c_str() );
cout << cs << endl;
char a = *cs;
int as = a;
cout << as << endl;
return 0;
}