| www.delorie.com/archives/browse.cgi | search |
| Date: | Tue, 13 Jun 2000 16:22:24 +0300 (IDT) |
| From: | Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> |
| X-Sender: | eliz AT is |
| To: | Alastair Hogge <al_ AT tpg DOT com DOT au> |
| cc: | DJGPP <djgpp AT delorie DOT com> |
| Subject: | Re: conversion specifier. |
| In-Reply-To: | <008501bfd532$7aee9380$de0f3acb@default> |
| Message-ID: | <Pine.SUN.3.91.1000613162029.18428D@is> |
| MIME-Version: | 1.0 |
| Reply-To: | djgpp AT delorie DOT com |
| Errors-To: | nobody AT delorie DOT com |
| X-Mailing-List: | djgpp AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie DOT com |
On Tue, 13 Jun 2000, Alastair Hogge wrote:
> My Code:
> unsigned long foo;
> printf("%d", foo);
>
> My compiler warnings:
> ...warning: int format, long int arg (arg 2)
>
> What does this mean?
It means what it says: the second argument of the call to printf is a
long int, but the format you are using to print it, "%d" is for int's,
not for long's. Use "%lu" instead, and the compiler will be happy (`u'
because it's an _unsigned_ long, not just long).
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |