From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,80ae9f89712e54ee X-Google-Attributes: gid1014db,public X-Google-Thread: fee84,80ae9f89712e54ee X-Google-Attributes: gidfee84,public From: reeh@bunsen.HRZ.Uni-Marburg.DE (Achim Reeh) Subject: Re: printf-problem Date: 1996/01/19 Message-ID: <4dojc3$g2j@surz03fi.HRZ.Uni-Marburg.DE>#1/1 X-Deja-AN: 135825065 distribution: world references: <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de> followup-to: comp.unix.osf.osf1,comp.lang.c organization: Department of Physics, University of Marburg, Germany reply-to: Achim.Reeh@mailer.uni-marburg.de newsgroups: comp.unix.osf.osf1,comp.lang.c 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