I'm getting inoput from a binary file, in hex.
And I want it to say the first nine characters... like "0x05 0x53,0x84 " ... and so on. So how do I turn a char in hex to a string in text?

cin >> hex; //set the input stream to read in hexadecimal 
long num = 0;
cin >> num; //input a number, example 15
cout<<hex<<showbase; // shows output as  0xsomeNumber
cout << num; //prints  0xf instead of 15

you can do the same with ifstream iFile("number.txt")
or ofstream oFile("numbers.txt");

change cout to oFile, and cin to iFile.

Try this...

#include <iostream>
#include <string>
#include <sstream>

char HexStrToChar(std::string HexStr)
{
    std::istringstream ist(HexStr);
    int value;
    ist >> std::hex >> value;
    return value;
}

int main()
{
   std::string text = "0x05 0x53 0x84";
   std::istringstream iss(text);
   while(iss >> text)
   {
      std::cout << HexStrToChar(text);
   }
}

I can't use cin or cout, it's an SDL program.
Also, it's char TO string, not the other way around.

I can't use cin or cout, it's an SDL program.
Also, it's char TO string, not the other way around.

Explain a bit more. Why cant you use C++ with sdl.

Are you using sdl to read in the file?