[[lesson_2_easy.cpp]] Rescued by C++ Reloaded

Route:


[user02@FC4 Lesson02]$ cat -n easy.cpp
1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 cout << "Programming in C++ is easy!\n"; 7 8 return 0; 9 }
[user02@FC4 Lesson02]$ g++ -o easy easy.cpp
[user02@FC4 Lesson02]$ ./easy
Programming in C++ is easy!



[user02@FC4 Lesson02]$ cat -n easy2.cpp
1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 cout << "Programming in C++ is easy!"; 7 cout << endl << "And pretty cool!\n"; 8 9 return 0; 10 }
[user02@FC4 Lesson02]$ g++ -o easy2 easy2.cpp
[user02@FC4 Lesson02]$ ./easy2
Programming in C++ is easy!
And pretty cool!



using endl rather than \n.

1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 cout << "Programming in C++ is easy!" << endl; 7 8 return 0; 9 }


1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 cout << "Programming in C++ is easy!" << endl; 7 cout << "And pretty cool!" << endl; 8 9 return 0; 10 }

lesson_2_easy.cpp, Rev. 4, Last changed on 2005-08-06 15:59, 336 page hits
Wiki hosted for free at wikihost.org || RSS-Feed || GeboGebo 1.3.3 || 00.983 seconds || || PAGERANK TOOLS