user02@FC4 Lesson02]$ cat -n first.cpp
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.
lesson_2_first.cpp, Rev. 5, Last changed on 2006-06-11 20:55, 418 page hits