Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

iostream vs. stdio

Name: Anonymous 2007-11-22 14:09

so, I've got EXPERT PROGRAMMERS telling me to use printf instead of cout in c++, ok but why? what is the difference (in b4 stream)

Name: Anonymous 2007-11-22 20:33

>>13
/* hello.c */
#include <stdio.h>
main() {
 printf("Hello world!");
}

633 bytes

// hello.cpp
#include <iostream>
using namespace std;
main() {
 cout << "Hello world!";
}

2560 bytes

Obtained with maximum optimization and dynamic linking enabled.

Another program I wrote (the details don't matter, the important thing is that it writes to standard output A LOT) -- again, maximum opts and dynlink:

All stdio: 12KB
All iostream: 40KB

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List