+ 1
What does this %1d means
2 odpowiedzi
+ 4
Tag language also...
%1d is same as %d. No make difference.
But
Ex:
%3d here 3 number says the reserve space for atleast 3 digits in output..
So it displayed like
100
9
Otherwise is it like
100
9
So there space is added,
To understand better
Run this code
printf("%5d", n) ;
If n=9,then it deplays
00009 (0 is appended, note to make it atleast 5 digits..) you can add anything like this..
If n= 99999, it displays same.. No appends..
%1d, since atleast int is 1 digit always.. No effect..
0
%ld means long integer