Home Segments Index Top Previous Next

20: Mainline

The following program, which computes the volume of a typical railroad box car, consists of just one function, the main function:

main ( ) { 
  11 * 9 * 40; 
} 

This main function consists of the function name, main, followed by matched parentheses—which you should ignore for now—followed by a single statement sandwiched between matched braces that delimit the function's body.

The one and only statement in the body of the main function contains two instances of the multiplication operator, *. Note that this statement, like most C++ statements, is terminated by a semicolon.

The semicolon, the parentheses, and the braces act as punctuation. Occasionally, such symbols, in such contexts, are called punctuators.

Note also that the sample program is quite catatonic: It accepts no input data and produces no output result.