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?
azjherben 0 Light Poster
Recommended Answers
Jump to Postcin >> 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 …
Jump to PostI 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.
All 6 Replies
mrnutty 761 Senior Poster

Rkeast
azjherben 0 Light Poster
mrnutty 761 Senior Poster
azjherben 0 Light Poster
mrnutty 761 Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.