Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: reeh@bunsen.HRZ.Uni-Marburg.DE (Achim Reeh)
Subject: Re: printf-problem
Date: 1996/01/19	[thread overview]
Message-ID: <4dojc3$g2j@surz03fi.HRZ.Uni-Marburg.DE> (raw)
In-Reply-To: 4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de

Henrik Wist (wist@lam.mw.tu-muenchen.de) wrote:
: Problem:
: long int zahl;   /* which is e.g. 10000500001 */
: printf("%d\n",zahl);      /* gives 1410565409, which is definitly wrong */

Solution:
  printf("%ld\n",zahl);      /* gives 10000500001 */
          ^^^
%ld is the format specifier for long int output. long ints are 64 bit 
under DEC Unix and DEC C. ints (format %d) have only 32 bit.

Achim
--
Achim Reeh, Achim.Reeh@mailer.uni-marburg.de



  parent reply	other threads:[~1996-01-19  5:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-01-17  5:00 printf-problem Henrik Wist
1996-01-17  5:00 ` printf-problem Alun Champion
1996-01-17  5:00 ` printf-problem P.Bennett
1996-01-17  5:00   ` printf-problem The Amorphous Mass
1996-01-17  5:00 ` printf-problem Lawrence Kirby
1996-01-18  5:00   ` printf-problem Dik T. Winter
1996-01-18  5:00 ` printf-problem Henrik Wist
1996-01-19  5:00 ` Achim Reeh [this message]
1996-01-22  5:00   ` printf-problem Norman Gaywood
  -- strict thread matches above, loose matches on Subject: below --
1996-01-17  5:00 printf-problem The Amorphous Mass
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox