<<< First C++ program, cont. | Index | First C++ program, cont. >>> |
#include <iostream>
int main()
{
std::cout << "Hello, World!";
return 0;
}
Second line contains main entry point into our program.
That is, when the program is loaded into memory, its execution begins here.
The word "main" is the name of a C++ function. C++ functions define computer operations. Entire combination int main() suggests two things:
main is a function with no input parameters, because parentheses are empty.
keyword int declares that main function returns an integer (number) back to the operating system.
Note: int and return are keywords (reserved words) of the C++ programming language.
<<< First C++ program, cont. | Index | First C++ program, cont. >>> |