C: double percent sign (%%) in printf() statement (and question about %3.2f)
Posted on 2013-10-02
Need a sanity check here.
In this statement:
printf(,"Percent Completed %3.2f%%\r",percent);
Am I correct in deducing that the %% is necessary to display a percent sign, to avoid a single % from being taken to be a format specifier?
Yeah, I know I should know this, but I'm reviewing a C file to be sure that there are no mismatched format specifiers (b/c the program occasionally crashes) and want to be sure this statement is OK.
In addition, is the %3.2f format specifier OK for a double, as well as a float? (This question applies to both 16-bit and 32-bit).