PracticeDev/study_cpp/cpp_primer_source_code/Chapter 2/myfirst.cpp

16 lines
856 B
C++
Raw Permalink Normal View History

2022-12-20 17:31:11 +08:00
// myfirst.cpp--displays a message
#include <iostream> // a PREPROCESSOR directive
int main() // function header
{ // start of function body
using namespace std; // make definitions visible
cout << "Come up and C++ me some time."; // message
cout << endl; // start a new line
cout << "You won't regret it!" << endl; // more output
// If the output window closes before you can read it,
// add the following code:
// cout << "Press any key to continue." <<endl;
// cin.get();
return 0; // terminate main()
} // end of function body