![]() |
%i and %d place holders.
Hi Guys.
Another quick question for you. I have just come across the %i place holder but i don't understand the difference between %i and %d. The section in my book that lists all the place holders says there both int place holders. In the program i am looking at it don't explain why the %i is used instead of %d. It's the first time i have come across the %i place holder. Sorry if it's a dumb question but i need to know everything :) |
Re: %i and %d place holders.
% i attempts to take as integer.
%d attempts to take decimal integer. |
Re: %i and %d place holders.
This example makes you more understand...
Code: c
Output:: asadulla ~/temp> gcc test1.cc execution gcc-3.3.1 asadulla ~/temp> ./a.out The Decimal values are : 150 85 The Decimal values are : 150 125 |
| All times are GMT +5.5. The time now is 09:52. |