delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/24/15:22:36

From: Damian Yerrick <MYNAMEISd_yerrick AT hotmail DOT comNO2CANNEDHAM>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Weird output of printf()
Organization: Pin Eight Software <http://pineight.8m.com/>
Message-ID: <bu5p8ssu61l28sbablj6glhjcpv1jdpmf1@4ax.com>
References: <388B34AB DOT CA34EBD9 AT ou DOT edu> <4nhm8s4eqkb8mvicavhlv866qio80e0h8l AT 4ax DOT com> <388B549C DOT A2C038D AT ou DOT edu>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 20
X-Trace: /Kkf2LwuHMUJcDm8yh8TlNnfErFwfdWg8jB/cfGxIspFrsTrfbTI7zJzclTLN+DRNLiCqfCgfWCY!2JrxHDAfhnax1eedWkRjX1Qh3E8ugTcS+KJR9XwO3tvmu59aGi89bhQoEjUe51wKM5KNR0xEJQ==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Mon, 24 Jan 2000 18:23:35 GMT
Distribution: world
Date: Mon, 24 Jan 2000 18:23:35 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Sun, 23 Jan 2000 13:21:00 -0600, David Cleaver <davidis AT ou DOT edu>
wrote:

>
>Well, if you really want to know the print line I'm using is:
>
>fprintf(out, "%#x", array0[looper1][looper2]);
>where array0 contains unsigned char's
>
>Anyway,  does the compiler actually think that 0xf is the same as 0x0f? 
>I personally think it should print out the leading zero, but, maybe
>thats just me.  Is there a way to get it to print out that leading
>zero?

"0x%2x" will give you 0x41 for 'A' or 0x0a for LF.

-- 
Damian Yerrick  http://yerricde.tripod.com/
View full sig at http://www.rose-hulman.edu/~yerricde/sig.html
Comment on story ideas at http://home1.gte.net/frodo/quickjot.html

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019