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++ 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++ 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++ 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++ 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.
C++11 Memory Model Explained: Threads, Atomics, and What Changed
Learn what the C++11 memory model is, why it matters for threads and atomics, and how it changed safe concurrent C++ programming.
Can You Access a Local Variable Outside Its Scope in C++? Dangling Pointers Explained
Learn why returning a pointer to a local variable in C++ is undefined behavior, even when the program seems to work.
Class vs Struct in C++: When to Use Each
Learn the difference between class and struct in C++, when to use each, common conventions, examples, and practical coding guidance.
Constructor Chaining in C++: How Delegating Constructors Work
Learn how constructor chaining works in C++ using delegating constructors, initializer lists, and common patterns for shared setup.
Page 1 of 6 - 110 questions