B
Ben Pfaff
Jamesm said:I am upgrading a large code base that I did not write and can not speak
with the original developer. I have encountered the following sprintf
format many times.
sprintf(buf, "%10.10d", somevar);
Where somevar is an int. Now to me the .10 part makes no sense since an
int is never going to have a fractional portion, so you would never use
that part of the format. I just want to make sure I am not missing some
sprintf functionality that I am unaware of before I remove them.
For %d, sprintf always outputs at least as many digits as
specified by the precision. Thus, %10.10d will output the number
1 as 0000000001.