Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: How to show a string with hexadecimal integer included?

Reply
Thread Tools

Re: How to show a string with hexadecimal integer included?

 
 
bd
Guest
Posts: n/a
 
      06-26-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Change a string to an integer, report an error if the string does not represent an integer? Randy Kramer Ruby 12 10-25-2007 09:56 PM
Converting negative integer to octal/hexadecimal jaks.maths@gmail.com C Programming 15 06-23-2006 12:06 PM
Re: How to show a string with hexadecimal integer included? Martin Ambuhl C Programming 1 06-26-2003 01:14 PM
Re: How to show a string with hexadecimal integer included? Derk Gwen C Programming 3 06-26-2003 11:03 AM



Advertisments
 



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