Questions
C++ questions
Choose a question page, learn the concept, then test your understanding with a quiz.
Advantages of Brace Initialization in C++
Learn why C++ brace initialization is often clearer and safer than other object initialization styles, with examples and common pitfalls.
Basic Rules and Idioms for Operator Overloading in C++
Learn the core rules, syntax, and common idioms for operator overloading in C++, including member vs non-member operators.
C++ Aggregates, Trivial Types, Trivially Copyable Types, and PODs Explained
Learn what aggregates, trivial types, trivially copyable types, and PODs mean in C++, how they differ, and why they matter.
C++ Base Class Constructor Rules Explained
Learn how C++ base class constructors are called from derived classes, including order, syntax, defaults, and common mistakes.
C++ Casts Explained: C-Style Cast vs static_cast vs dynamic_cast
Learn the difference between C-style casts, static_cast, and dynamic_cast in C++ with clear examples, safety rules, and real usage tips.
C++ Const Member Functions: Meaning and Usage
Learn what const after a C++ member function means, how it protects object state, and when to use const member functions correctly.
C++ File Extensions Explained: .cc vs .cpp on Linux
Learn the difference between .cc and .cpp in C++, when to use each, and how teams choose file extensions on Linux projects.
C++ Functors Explained: What They Are and When to Use Them
Learn what C++ functors are, how operator() works, and when function objects are useful in STL algorithms and real codebases.
C++ Fundamental Type Sizes: What the Standard Guarantees About int, long, char, float, and double
Learn what the C++ standard guarantees about fundamental type sizes, including int, long, char, float, and double across platforms.
C++ Header File Extensions: .h vs .hpp Explained
Learn the difference between .h and .hpp in C++, when each is used, and how teams choose a header naming convention in real codebases.
C++ Iterator Invalidation Rules for Standard Containers
Learn C++ iterator invalidation rules for vector, deque, list, maps, and unordered containers, with safe erase and insertion patterns.
C++ Lambda Expressions Explained: What They Are and When to Use Them
Learn what C++ lambda expressions are, why they exist, when to use them, and how they simplify callbacks, algorithms, and local logic.
C++ Most Vexing Parse: Why `Foo foo2()` Is Not an Object
Learn why C++ reads `Foo foo2()` as a function declaration, how the most vexing parse works, and safe ways to create default objects.
C++ Template Definitions in .cpp Files: Explicit Instantiation Explained
Learn when C++ template definitions can live in .cpp files, how explicit instantiation works, and how portable it is across compilers.
C++ Template Parameters: class vs typename
Learn when to use class or typename in C++ template parameters, why they are usually equivalent, and the key dependent-name distinction.
C++ Value Categories Explained: lvalues, rvalues, xvalues, glvalues, and prvalues
Learn C++ value categories clearly: lvalues, rvalues, xvalues, glvalues, and prvalues, with examples and why C++11 introduced them.
C++ mutable Keyword Explained: Const Member Functions, Caches, and Mutexes
Learn what the C++ mutable keyword does, why it works with const member functions, and when to use it for caches, mutexes, and internal state.
C++ new Expression: Difference Between `new Test` and `new Test()`
Learn the difference between `new Test` and `new Test()` in C++, including default initialization, value initialization, and class behavior.
C++ nullptr Explained: Why It Is Better Than NULL and 0
Learn what nullptr means in C++11, how std::nullptr_t works, and why nullptr is safer and clearer than NULL or 0.
C++ typedef vs using: Type Aliases Explained
Learn the difference between C++ typedef and using, including type aliases, alias templates, syntax, and when to use each.
Page 1 of 7 - 134 questions