| View previous topic :: View next topic |
| Author |
Message |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Tue Sep 30, 2008 9:17 am Post subject: C++ dec in hex(no converting, need the same numbers in hex) |
|
|
| Here was a dumb question, please ignore.
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Tue Sep 30, 2008 7:15 pm Post subject: |
|
|
DWORD lolwat;
sprintf(lolwat, "%X08", 9048093);
Not possible without conversion...
|
|
| Back to top |
|
 |
GMZorita Grandmaster Cheater Supreme
Reputation: 0
Joined: 21 Mar 2007 Posts: 1361
|
Posted: Tue Sep 30, 2008 7:18 pm Post subject: Re: C++ dec in hex(no converting, need the same numbers in h |
|
|
| redhead wrote: | | Here was a dumb question, please ignore. |
You mean like a string?
String num = 7A;
num = "0x"+num;
Because the title looks like.
same number in hex?
either you want
10 = 0x10
or 10 = 0xC
Depends on the usage, you wan't to output it?
Use IntToHex((int)IntGoesHere,8);
Eg. IntToHex((int)485025,8); returns = "000766A1"
_________________
Gone |
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Wed Oct 01, 2008 3:54 am Post subject: |
|
|
| Code: | | std::cout << std::hex << 69; |
|
|
| Back to top |
|
 |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Wed Oct 01, 2008 6:33 am Post subject: Re: C++ dec in hex(no converting, need the same numbers in h |
|
|
| GMZorita wrote: | | redhead wrote: | | Here was a dumb question, please ignore. |
You mean like a string?
String num = 7A;
num = "0x"+num;
Because the title looks like.
same number in hex?
either you want
10 = 0x10
or 10 = 0xC
Depends on the usage, you wan't to output it?
Use IntToHex((int)IntGoesHere, ;
Eg. IntToHex((int)485025, ; returns = "000766A1" |
I wanted 10 = 0x10 (or 10 = 16).
But it doesn't matter anymore, I found some mistakes on my calculating and I don't need that anymore.^^
Thx anyway
|
|
| Back to top |
|
 |
|