I
Ian Collins
Le 22/05/12 23:31, Ian Collins a écrit :Le 22/05/12 21:33, Adam Skutt a écrit :
Le 22/05/12 05:27, Adam Skutt a écrit :
It means I can pass any object to the formatting function, and I don't
have to remember the stupid formatting code (if I don't need special
behavior), nor do I have to remember to treat certain types
specially.
Sure, then the boss says:
"I want rounding to 2 decimals, names flush left in the first
column that must be 16 chars long"
printf("%-16s|%10.2g|\n",name,value);
And how would it look in C++ please?
Just compare then.
sprintf to a buffer, output the buffer.
Yes!.
KISSes!
Simplicity is golden.
How's your list example coming along?