Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   Re: How to show a string with hexadecimal integer included? (http://www.velocityreviews.com/forums/t313845-re-how-to-show-a-string-with-hexadecimal-integer-included.html)

bd 06-26-2003 05:10 PM

Re: How to show a string with hexadecimal integer included?
 
On Wed, 25 Jun 2003 23:50:11 +0000, Christopher Culver wrote:

> I have a string which should include a hexadecimal number. I've tried %x
> like this:
>
> printf("This is a hex number: %x", hexNumber)
>
> but this results in only the minimum number of digits being displayed,
> i.e. "7e" instead of "0x007e". Is there anything I can use in place of %x
> which will display the fully qualified hexadecimal number?
>
> Christopher Culver


0x%04x is probably what you want.

--
Freenet distribution not available
BOFH Excuse #95:

Pentium FDIV bug



All times are GMT. The time now is 08:51 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57