[Dev-C++] %d and %ld printf output formats
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <and...@su...> - 2003-08-26 03:30:54
|
Dear users,
Please consider the following C code:
...
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.
Even in lines 5 and 7. I though the 2 complement would start presenting the
complement values.
Does anybody can explain what happend?
Regards
Andre
|