(printf VS cout) and (including libraries)
I wondered if printf and cout did the same thing, so I build 4 "hello world" programs.
- In the first one, I used printf and included <stdio.h>. It had about 4400 bytes.
- In the second one, I did the same as the first, but included <iostream.h> as well. It had about 4600 bytes.
- In the third one, I used cout << "Hello World\n" and included <iostream.h>. It had about 4800 bytes.
- In the last one, I used cout << "Hello World" << endl and included <iostream.h>. it had about 5000 bytes.
My question is: Are this differences significant in a large program?
I don't think so, but cout is just c++ i believe.
It's entirely implementation dependant. Don't pay attention to the numbers.