Questions

C++ questions

Choose a question page, learn the concept, then test your understanding with a quiz.

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.

cppoperatorsoperator-overloadingc++-faq

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.

cpppointerscasting

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.

cpplambdac++11c++-faq

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.

cppc++11expressionc++-faq

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.

cppc++11typedefusing-declaration

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.

cppmultithreadingc++11language-lawyer

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.

cppoopclassstruct

Copy-and-Swap Idiom in C++: What It Is, Why It Matters, and When to Use It

Learn the copy-and-swap idiom in C++, how assignment works, what problems it solves, and how C++11 move semantics affect it.

cppcopy-constructorassignment-operatorc++-faq

Dependent Names, typename, and template in C++ Templates

Learn when and why to use typename and template with dependent names in C++ templates, with clear examples and common pitfalls.

cpptemplatestypenamec++-faq

Handling Cycles in Family Tree Graphs in C++ and Qt

Learn how to model and process cycles in family tree software using C++ and Qt without breaking assertions or graph logic.

cppgraphcycleassertions

How to Convert int to String in C++

Learn how to convert int to string in C++ using std::to_string, stringstream, and older approaches with clear examples.

cppstringtype-conversioninteger

How to Iterate Over Words in a String in C++

Learn how to iterate over whitespace-separated words in a C++ string using stringstream, extraction operators, and clean loop patterns.

cppstringsplit

How to Learn C++ from Books: A Beginner-Friendly Guide to Choosing the Right C++ Book

Learn how to choose good C++ books by skill level, avoid bad resources, and build a practical C++ learning path with confidence.

cppc++-faq

How to Profile C++ Code on Linux

Learn how to profile C++ code on Linux to find slow functions, bottlenecks, and performance hotspots using practical examples.

cpplinuxprofiling

Improving Object Recognition Algorithms in OpenCV with Template Matching and Feature-Based Detection in C++

Learn how to improve OpenCV object recognition in C++ for scale, rotation, noise, occlusion, and false positives using practical techniques.

cppalgorithmimage-processingopencv

Pointer vs Reference in C++: What’s the Difference?

Learn the difference between pointers and references in C++ with syntax, examples, mistakes, and practical use cases.

cpppointersreferencec++-faq

Pointers vs Objects in C++: Why Use a Pointer Instead of the Object Itself?

Learn when to use pointers vs objects in C++, how memory and ownership work, and why direct objects are often the better default.

cppc++11pointersc++-faq

The Rule of Three in C++: Copying Objects, Copy Constructor, and Copy Assignment

Learn the Rule of Three in C++: what object copying means, when to define copy operations, and how to prevent copying safely.

cppcopy-constructorassignment-operatorc++-faq

Undefined Reference and Unresolved External Symbol Errors in C and C++

Learn what undefined reference and unresolved external symbol errors mean in C and C++, their causes, fixes, and how to prevent them.

cpplinker-errorsundefined-referencec++-faq

What Are Smart Pointers in C++ and When Should You Use Them?

Learn what smart pointers are in C++, how they manage memory automatically, and when to use unique_ptr, shared_ptr, and weak_ptr.

cpppointersc++11smart-pointers

Page 1 of 2 - 32 questions

PreviousNext