🌍 C++ Programming · subject
C++ Programming Basic Syntax Syllabus
Every chapter and topic of Basic Syntax examined in C++ Programming — 3 chapters, 12 topics, plus 50 flashcards written against it.
Basic Syntax syllabus — full chapter and topic list
Expand any chapter to see its topics and sub-topics. This is the whole examinable outline for Basic Syntax in C++ Programming, not a summary of it.
-
Variables and Data Types
3 topics- Primitive Data Types
- User-defined Data Types
- Type Modifiers
-
Operators
6 topics- Arithmetic Operators
- Relational Operators
- Logical Operators
- Bitwise Operators
- Assignment Operators
- Miscellaneous Operators
-
Control Structures
3 topics- If-Else Statements
- Switch Case
- Loops (For, While, Do-While)
Basic Syntax flashcards for C++ Programming
21 of 50 cards from the Basic Syntax deck — real questions with worked answers.
What are the fundamental primitive data types in C++?
The built-in primitives are: `int` (integer), `char` (character), `bool` (boolean), `float` (single-precision floating point), `double` (double-precision floating point), `void` (valueless), and `wchar_t` (wide character).
What is the typical size (in bytes) and value range of a standard `int` on most modern systems?
A standard `int` is typically 4 bytes (32 bits), giving a signed range of $-2^{31}$ to $2^{31}-1$, i.e. $-2{,}147{,}483{,}648$ to $2{,}147{,}483{,}647$.
How many bytes does a `char` occupy in C++, and what is guaranteed about its size?
A `char` is always exactly 1 byte by definition ($\texttt{sizeof(char)} = 1$). The C++ standard guarantees a byte holds at least 8 bits.
What are the only two values a `bool` can hold, and what integer values do they convert to?
A `bool` holds `true` or `false`. When converted to an integer, `true` becomes $1$ and `false` becomes $0$; any nonzero value converts back to `true`.
What is the difference between `float` and `double` in C++?
`float` is single-precision (typically 4 bytes, ~7 significant decimal digits), while `double` is double-precision (typically 8 bytes, ~15-16 significant decimal digits). `double` has greater range and precision.
What is the purpose of the `void` type in C++?
`void` represents the absence of a type/value. It is used as the return type of functions that return nothing, for generic pointers (`void*`), and to indicate a function takes no parameters.
List the four categories of user-defined data types in C++.
The main user-defined types are: `struct` (structure), `class`, `union`, and `enum` (enumeration). Type aliases via `typedef`/`using` are also user-defined.
What is the key default access-level difference between a `struct` and a `class` in C++?
In a `struct`, members are `public` by default; in a `class`, members are `private` by default. Otherwise they are functionally equivalent.
What is a `union` in C++ and what is its defining memory characteristic?
A `union` is a user-defined type whose members all share the same memory location, so only one member holds a valid value at a time. Its size equals the size of its largest member.
What does an `enum` (enumeration) do, and what value does the first enumerator get by default?
An `enum` defines a type consisting of named integer constants. By default the first enumerator is $0$, and each subsequent one increments by $1$ unless explicitly assigned.
What is a scoped enumeration (`enum class`) and how does it differ from a plain `enum`?
An `enum class` (scoped enum) does not implicitly convert to `int` and its enumerators must be accessed with scope resolution (e.g. `Color::Red`), preventing name clashes and unsafe conversions that plain `enum` allows.
What is the difference between `typedef` and the `using` alias declaration in C++?
Both create type aliases. `typedef OldType NewName;` is the classic form; `using NewName = OldType;` is the modern (C++11) form that reads left-to-right and also supports alias templates.
Name the four type modifiers used to alter the meaning of base data types in C++.
The four modifiers are: `signed`, `unsigned`, `short`, and `long`. They can be combined (e.g. `long long int`).
What is the difference between a `signed` and an `unsigned` integer type?
`signed` types can hold negative and positive values; `unsigned` types hold only non-negative values but double the positive range. For an $n$-bit type, unsigned range is $0$ to $2^{n}-1$.
What is the minimum size guarantee of `long long int`, and its typical signed range?
`long long int` is at least 8 bytes (64 bits), giving a signed range of $-2^{63}$ to $2^{63}-1$.
What does the `const` type qualifier do in C++?
`const` makes an object immutable after initialization; any attempt to modify it is a compile-time error. It is a type qualifier (technically a cv-qualifier) rather than a size modifier.
List the five basic arithmetic operators in C++.
They are: addition `+`, subtraction `-`, multiplication `*`, division `/`, and modulus `%`.
What does the modulus operator `%` compute, and what type restriction does it have in C++?
`%` returns the remainder of integer division (e.g. $17 \% 5 = 2$). It works only on integer operands; applying it to `float`/`double` is a compile-time error.
In C++, what is the result of `7 / 2` versus `7.0 / 2`, and why?
`7 / 2` yields $3$ (integer division truncates toward zero), while `7.0 / 2` yields $3.5$ because at least one operand is floating point, so floating-point division is performed.
What is the difference between the pre-increment `++x` and post-increment `x++` operators?
`++x` increments `x` then returns the new value; `x++` returns the original value then increments. In an expression, if $x=5$, `++x` gives $6$ while `x++` gives $5$ (with `x` becoming $6$ afterward).
List the six relational (comparison) operators in C++ and the type of value they produce.
They are `==` (equal), `!=` (not equal), `<` (less than), `>` (greater than), `<=` (less than or equal), and `>=` (greater than or equal). Each yields a `bool` (`true`/`false`).
Planning Basic Syntax for C++ Programming
Basic Syntax is about 18% of the C++ Programming syllabus by topic count — 12 of 65 topics, spread over 3 chapters. At roughly 45 minutes per topic plus 12 minutes per sub-topic, a first pass runs to about 9 hours.
The heaviest chapters are Operators (6 topics), Variables and Data Types (3 topics), Control Structures (3 topics) . Front-load those while your energy is high; the short chapters are better revision filler later.
Work top-down: read the chapter, then tick topics off individually rather than marking the whole chapter done. Sub-topics are where silent gaps hide.
Basic Syntax (C++ Programming) FAQ
What is in the C++ Programming Basic Syntax syllabus?
Basic Syntax is split into 3 chapters — Variables and Data Types, Operators and Control Structures, containing 12 topics and 0 sub-topics in total.
How is Basic Syntax structured in the C++ Programming syllabus?
3 chapters. Basic Syntax accounts for about 18% of the topics in the whole C++ Programming syllabus (12 of 65).
How long should I spend on Basic Syntax for C++ Programming?
Budget around 9 hours for a first pass through Basic Syntax — about 45 minutes per topic plus 12 minutes per sub-topic across its 12 topics. Add revision cycles on top.
Are there flashcards for C++ Programming Basic Syntax?
Yes — a 50-card Basic Syntax deck. Sample cards are printed on this page, and the full deck is free in the Examius app with spaced repetition scheduling.