lesson 2 first cpp
[[lesson_2_first_cpp]] last edit on
Jun 11, 2006
8:55 PM
by Anonymous
user02@FC4 Lesson02]$ cat -n first.cpp
[user02@FC4 Lesson02]$ ./first
Rescued by C++!
Only way to tell would be to check out the binary produced... I somehow doubt the latter would be better, and most likely, both produce exactly the same code.
1 #include <iostream>
2 using namespace std;
3
4 int main()
5 {
6 cout << "Rescued by C++!\n";
7 8 return 0; 9 }[user02@FC4 Lesson02]$ g++ -o first first.cpp
[user02@FC4 Lesson02]$ ./first
Rescued by C++!
endl flushes buffer is better than \n ?
1 #include <iostream>
2 using namespace std;
3
4 int main()
5 {
6 cout << "Rescued by C++!" << endl;
7
8 return 0;
9 }
Only way to tell would be to check out the binary produced... I somehow doubt the latter would be better, and most likely, both produce exactly the same code.