C++ TutorialLesson 4Free preview
C++ Syntax
This lesson is part of C++ · All levels
Summary
This lesson explains the rules of C++ code writing that must be followed for a program to be compiled. You'll learn about the structure of the block code with curly braces, the use of namespace etc, and the importance of semicolon. And you also practice reading the order of expressions so that the output results can be predicted correctly.
Key points
- The block code is bounded by curly braces.
- Each statement ends with a semicolon (;).
- Using namespace std; allows cout writing without the prefix std::.
- The order of the operators follows the rule of precedence, for example * is calculated before +.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.