Like I said, personal project. I wouldn't make it long in a programming class.
So what I want to do is be able to type in text, in this example, "Hello", then have the console print out the hexadecimal form, "68656c6c6f". But I want to be able to type it in and have it convert my input, not have the program pre-set to automatically tell me what "hello" is.
Am I on the right track here?
1 2 3 4 5 6 7
int main ()
{
int x;
cin >> x;
std::cout << std::hex << x;
system("pause");
}
(Yes I know using system() is a huge no-no, but for this application it's acceptable to me.)
So you want to read in a text string and output the hex value of each character's ASCII code? You could read into a string using getline() then print each character in hex mode like you were doing above.