Spad3z
asked on
Change Format to hex
Hello experts,
My question that I've been stuck on for a while is how can i add "0x" in front of a number without changing the actual number itself.
In VC++ using namespace System It can be done like so..
But i want to do that exact thing without using the namspace System, and System::String.
and one more thing instead of having the number displayed into "txtNumber->Text" I'd rather have it be put back into "int Number". So each time i use "Number" it'll equal "0x123456".
Thanks for your help.
My question that I've been stuck on for a while is how can i add "0x" in front of a number without changing the actual number itself.
In VC++ using namespace System It can be done like so..
int Number = 123456;
txtNumber->Text = Number.ToString("X8")
txtNumber->Text will show "0x123456". But i want to do that exact thing without using the namspace System, and System::String.
and one more thing instead of having the number displayed into "txtNumber->Text" I'd rather have it be put back into "int Number". So each time i use "Number" it'll equal "0x123456".
Thanks for your help.
The number 123456 is Not the same as 0x123456. Try it in your calculator. 0x123456 = 1193046 decimal.
ASKER
@DaveBaldwin - Yes I'm aware of that, I merely just want to add "0x" infront of any number. or if this makes things easier. Make 1193046 into 0x123456 within "int Number".
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No solution found, as DaveBaldwin said does not work like that. I've found a way around my issue. Thank you for your time.
You're welcome, thanks for the points.