On Mon, 2005-05-16 at 19:05 -0400, Dave Dunfield wrote:
... the wrong
answer being to dump out each array element followed by a
comma, then output ^H as the final step in the function ;-)
Works poorly on hardcopy devices :-)
That's what tippex is for :)
Real
Programmers would presumably use putc exclusively in favour of the
more computationally expensive printf...
...
- Codesize compiled from C for the 8086 (my Micro-C) is 688 bytes.
- Code size of comparable routine hand crafted in assembly language
for my 8051 compiler library is 437 bytes (although this adds a
new %i for strings in internal memory).
- Code size for the C-FLEA (a virtual processor I developed which is
an optimized C target) is 335 bytes.
I stand corrected - that's quite impressive. Sure, Windows is bloated,
but I still would have guessed on a couple of kb or so of code. As you
say, lack of floating-point isn't exactly the end of the world...
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));
This is why I really don't like C much :-) (Although I do insist on
using it a lot of late...)
cheers
J.