On Mon, 16 May 2005, Dave Dunfield wrote:
Um, if
you're anal like me, you don't want to print a comma after the last
value, so:
...
printf ("%u", *aryp);
if (i<n) printf (", ");
Um, the original code won't print a comma after the last value.
You could of course do something "clever" to make the
extra conditional harder to see like:
for(i=0; i < n; ++i)
printf("%u%s", aryp[i], ","+(i >= n));
Um, you're right, but yours does ;)
(Can you spot the error? ;)
--
Sellam Ismail Vintage Computer Festival
------------------------------------------------------------------------------
International Man of Intrigue and Danger
http://www.vintage.org
[ Old computing resources for business || Buy/Sell/Trade Vintage Computers ]
[ and academia at
www.VintageTech.com || at
http://marketplace.vintage.org ]