Parts of the Program
This program consists of a single function called main. This function, which appears on line 1, has two parameters (inside the parentheses) and returns a number value (the starting int).
A function is a single group of code lines that perform a particular task. It has a heading at the top, with the function name as the second word and a body that starts with an opening brace ({) and ends with a closing brace (}). The closing brace optionally ends with a semicolon. More details about functions will be discussed in Lesson 7, “Functions.”
main is a function that is required in all C++ programs. Your system provides the parameters it receives (called arguments for reasons beyond our interest in this lesson). These are
int argc ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access