Jump to content
  • Advertisement
Sign in to follow this  
phil05

c++: need help converting a decimal number to hex

This topic is 5146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Thanks, however, it just seems to print the LSD (least significant digit) instead of the full hex representation aka 0x00000001. Instead it's only 1. Any way around this?

Share this post


Link to post
Share on other sites
Yep it worked. Now it's just not showing 0x before the numbers. I could use cout to put it in, but if any better way, please let me know. Thanks for the help.

Share this post


Link to post
Share on other sites
yeah, you'll have to put the "0X" in yourself, it is C/C++ code to signify a hex number, not a universal way of displaying hex.

Share this post


Link to post
Share on other sites
Quote:
Original post by philvaira
I'm leaving this unhelpful site.


Actually, IIRC cout provides a mechanism to print the preceding 0x, but I can't remember exactly what it was...



[Edited by - evolutional on September 14, 2004 4:28:53 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!