|
|
|
|
|
|
|
A block is just a sequence of zero or more statements enclosed (delimited) by a { } pair. Now we can redefine a function definition as a heading followed by a block: |
|
|
|
|
|
|
|
|
In later chapters when we learn how to write functions other than main, we'll define the syntax of Heading in detail. In the case of the main function, Heading is simply |
|
|
|
|
|
|
|
|
Here is the syntax template for a statement, limited to the C++ statements discussed in this chapter: |
|
|
|
|
|
|
|
|
A statement can be empty (the null statement). The null statement is just a semicolon (;) and looks like this: |
|
|
|
|
|