delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/11/18/23:30:46

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Rod Pemberton" <donthave AT noreply DOT bit>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: printf() doesn't print long long intege, maybe RHIDE problem
Date: Fri, 18 Nov 2005 23:16:43 -0500
Organization: Aioe.org NNTP Server
Lines: 34
Message-ID: <dlm8uk$elj$1@domitilla.aioe.org>
References: <437d9a13 AT news DOT bezeqint DOT net> <9krff.1763$wf DOT 538 AT newsread3 DOT news DOT atl DOT earthlink DOT net> <437e55e2 DOT 279951667 AT localhost> <Cxvff.2173$N45 DOT 189 AT newsread1 DOT news DOT atl DOT earthlink DOT net>
NNTP-Posting-Host: pCFjXAYAthfOLF6YhIh1ZA.540.domitilla.aioe.org
X-Complaints-To: abuse AT aioe DOT org
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-Priority: 3
X-MSMail-Priority: Normal
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Martin Ambuhl" <mambuhl AT earthlink DOT net> wrote in message
news:Cxvff.2173$N45 DOT 189 AT newsread1 DOT news DOT atl DOT earthlink DOT net...
> Scott wrote:
> > On Fri, 18 Nov 2005 21:03:01 GMT, Martin Ambuhl <mambuhl AT earthlink DOT net>
> > wrote:
> >
> >
> >>>printf() do not print long long integer.
> >>
> >>Show us how it fails.  Here is an example of it working:
> >
> > <snip example>
> >
> > Here's another example:
> >
> > printf("%llX\n", (long long)-1);
>
> If you mean an example of undefined behavior.  The %llX specifier
> expects an unsigned long long; (long long)-1 is not unsigned.

It's probably better to use capital L, instead of ll, since it works with
multiple compilers...
e.g.,

sscanf(s,"%Lx",&value);

printf("%Lu:%Lx\n",prime,counter);


Rod Pemberton



- Raw text -


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