C++20 sections · 1024 units
Open in Course

Vocabulary - Syntax

Language structure

Syntax is the set of rules defining valid C++ code. Just as English requires subjects and verbs, C++ requires semicolons, braces, and specific keywords. The compiler checks syntax before translating your code.

If you write cout < "Hello" with one < instead of two, the compiler rejects it. Syntax errors are easy to fix once you learn the rules. Read error messages carefully - they tell you what the compiler expected.