From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: Weird output of printf() Organization: Pin Eight Software Message-ID: <4nhm8s4eqkb8mvicavhlv866qio80e0h8l@4ax.com> References: <388B34AB DOT CA34EBD9 AT ou DOT edu> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 27 X-Trace: /K49oBBrl/znm85R+RpErWgP8KL3qcqiTEkTDaI3J9EZQXt5ViDBgLLl4s7NDqPFVxsfp5AM0yQN!ipnLpSUUaFaXl0dqMAtG2dDXpOoqtlRchfGv0E982Rgz3QIG+7/GNPiemQLi3tbYfE0icKndoA== 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: Sun, 23 Jan 2000 18:27:17 GMT Distribution: world Date: Sun, 23 Jan 2000 18:27:18 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 11:04:43 -0600, David Cleaver wrote: >Hello again everyone, > >First, I want everyone to know I'm using DJGPP v2.03. OK, now, recently >I've tried to use the printf() function to print out the hex values of >some unsigned char's that I have. However, I'm not sure that it always >did just that. Let me give you an example: > >{ 0xbc, 0xf, 0}, > >This is part of the output of the program. My question is, WHAT does >"0xf" mean????????? If you're using char to hold keypresses: 0xf = binary 00001111 = ascii code for Ctrl+O If you're using char as an 8-bit integer: 0xf = decimal 15 Does your line look anything like this? printf("character %c = 0x%x\n", c, (int)c); -- 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