Displaying hex values

Is there any control to display hex (hex values in left and letters in right)?
Thanks.
I need to do this in windows, not in console.
It's easy enough to output the hex yourself. Pick a fixed-width font and set the field width so it lines up nicely.
What do you men 'in windows' ?
You can use manipulators also with stringstreams and then get the resulting string
closed account (S6k9GNh0)
The console is a feature provided by the Operating System compatible with the C++ STL. The function's aren't MEANT for the console, they simply work with them. Even COUT can be used for other things besides console streaming. As a result of these facts, all of the functions work without a console. The functions work "in windows".
Last edited on
@Bazzy: when i said in windows i wanted to make an edit control to show hex values:
00 10 FF 08 AF 09 ..A@C.
FA EF AA 00 00 10 amtp..
09 40 53 EF 00 11 ...ms.
11 BF 00 00 F0 0F ....q.

I think you have seen something like this...
@computerquip: if i have used file.open() in console based app then i can use it in windows app and i don't need to change it to CreateFile() -that's true. But using cout << in something other than console... i don't know...
As I said above, use a stringstream to get a string formatted in the way you want
eg:
1
2
3
4
stringstream ss;
ss << hex << 123456;

string result = ss.str();
and then use it to set the text of whatever you need
closed account (S6k9GNh0)
@ Null: Cout is directed towards a stream. You can simply redirect the stream to another stream and it works. Though I don't remember how to do this, a good friend of mine showed up a bunch o' geeks in our group by making an example of this using a flat text file. I am NOT saying I recommend it..
Last edited on
http://www.cplusplus.com/reference/iostream/ios/rdbuf/

If you write your own streambuf, you can do whatever you want with it.
Thank you guys. I'm doing this right now. But anyway, is there any function or control to do all this?
Topic archived. No new replies allowed.