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++ Compilation and Linking Process Explained
Learn how C++ source files become executables through preprocessing, compilation, assembly, linking, translation units, libraries, and symbols.
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++ Global Scope Resolution Operator (::) Explained
Learn how C++ uses a leading double colon (::) to look up global namespaces and avoid name conflicts in classes and typedefs.
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++ Placement New: Uses, Object Lifetimes, and Safe Examples
Learn what C++ placement new does, why allocators and object pools use it, and how to safely construct and destroy objects in existing storage.
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++ const Function Parameters: Effects and Function Signatures
Learn how top-level const on C++ value parameters protects only a local copy, why it is ignored in function signatures, and when const matters.
Page 1 of 8 - 158 questions