I was getting confused over the use of precision format specifiers for strings.
Like we use
printf("%4.2d",somevar);
to talk about decimal places,
what does it mean in case of a string as in
what does
printf("%4.2s",somestringvar);
mean?
Printable View
I was getting confused over the use of precision format specifiers for strings.
Like we use
printf("%4.2d",somevar);
to talk about decimal places,
what does it mean in case of a string as in
what does
printf("%4.2s",somestringvar);
mean?
It means nothing. Strings don't have decimal points.
EDIT: Oops, I was wrong. The precision specifies the maximum number of characters to print. The left hand side is the minimum number of characters to print (any fewer characters than this will print padding)
http://msdn2.microsoft.com/en-us/lib...14(VS.80).aspx
You can use search as well...