Writing a Simple C++ Program
int main()
{
return 0;
}
A function definition has four elements: a return type,a function name,a(possibly empty)parameter list enclosed in parentheses,a function body.
Note
Note the semicolon at the end of the return statement.Semicolons mark the end of most statements in C++.They are easy to overlook but,when forgotten,can lead to mysterious compiler
error messages.
Key Concept:Types
Types are one of most fundamental concepts in programming and a concept that we will come back to over and over in this Primer.A type defines both the contents of adata element and the operations that are possible on those data.
The data our programs manipulate are stored in variables and every variable has a type.When the type of a variable named v is T, we often say that “v has type T”or,interchangeably,that “v is a T.”