Lets see...
hello world test:
#include <stdio.h>
main() { printf("hello world\n"); }
vs
#include <iostream.h>
main() { cout << "Hello World\n"; }
And the results are:
- Size
- printf size: 11735 (unstriped), 3012 (stripped)
- cout size: 12426 (unstriped), 3628 (stripped)
- Libs
- printf
- libc.so.6
- /lib/ld-linux.so.2
- cout
- libstdc++-libc6.1-1.so.2
- libm.so.6
- libc.so.6
- /lib/ld-linux.so..2
- page faults
Quick and dirty? Well, certainly quick, hardly dirty. I must admit
it has gotten better... it used to include libcurses when iostream
was used. But still, what does it need libm for?
And still, the thought of trying to do this with iostreams scares me.
sprintf(format,"%%.%ds\n",(ptr>=end_tape)?ptr+1:end_tape);
printf(format,tape);