What is the difference between printf ("% i") and printf ("% d")

Possible duplicate:
Difference between% i and% d format specifiers in printf

I just checked the link, it says that both of them indicate a signed integer. I thought there must be some difference

+5
source share
1 answer

There is no difference.

From standard document C99, section 7.19.6.1:

d, i

The int argument is converted to a decimal sign in the style of [-] dddd. Accuracy indicates the minimum number of digits; if the converted value can be represented by fewer digits, it is expanded with leading zeros. The default value is 1. Result. Converting a null value to the nearest zero is not a symbol.

+5

All Articles