O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required