Re: [Dev-C++] %d and %ld printf output formats
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: w.y. <yok...@ve...> - 2003-08-26 05:28:43
|
André Macário Barros wrote:
>
> int var=65534;
>
> 1- printf("%d\n", var);
> 2- var++;
> 3- printf("%d\n", var);
> 4- var*=1000;
> 5- printf("%d\n", var);
> 6- var++;
> 7- printf("%d\n", var);
> ...
>
> I though that above 65535 (or 32767!) I would need the %ld output format,
> but It wasn´t necessary.
int has been 32 bits for some time now. :)
Try setting var to 0x7FFFFFFF and you will see what you
expected.
|