As of now I’m using below line to print with out dot’s
fprintf( stdout, '%-40s[%d]', tag, data);
I’m expecting the output would be something like following,
Number of cards..................................[500] Fixed prize amount [in whole dollars]............[10] Is this a high winner prize?.....................[yes]
How to print out dash or dot using fprintf/printf?
A faster approach:
If the maximum amount of padding that you’ll ever need is known in advance (which is normally the case when you’re formatting a fixed-width table like the one you have), you can use a static ‘padder’ string and just grab a chunk out of it. This will be faster than calling
printforcoutin a loop.You could even do it in one statement, with some leap of faith: