C++

23 articles in this topic

C++ Compiler Warnings and Sanitizers: Catch Bugs Early

Build a practical C++ safety net with strict warnings and sanitizer runs. Three small programs show how to find, explain and fix defects before they spread.

Updated 4 Sep 20266 min readC++

C++ Arrays vs std::array vs std::span: Choose the Right Interface

Run the same five integers through raw-array, std::array and std::span interfaces, then choose from their ownership, size and lifetime contracts.

Updated 2 Sep 20266 min readC++

C++ Classes and Objects MCQs: 11 Solved Questions on Members, Pointers and Inheritance

Work through 11 C++ classes and objects MCQs, then use the fresh explanations and fixed examples to repair mistakes in access, lifetime and inheritance rules.

Updated 1 Sep 20268 min readC++

C++20 Modules: Interface Units, Imports and Build Order with a Worked Library Split

Follow one small C++20 module from its exported interface through a hidden implementation and importing client. Trace the result and build dependency graph.

Updated 30 Aug 20266 min readC++

File Handling in C++: Read, Write, Append and Seek with Examples

Learn how C++ file streams work through connected text and binary examples, from safe record parsing to appending data and updating a fixed record.

Updated 29 Aug 20266 min readC++

Arrays in C++: Sequential Storage, Indexing and Worked Examples

Build one C++ array from declaration to traversal, updates, memory addresses, fixed-capacity insertion and deletion, then extend the model to two dimensions.

Updated 27 Aug 20265 min readC++

C++ Move Semantics Tutorial: Trace Ownership with Runnable Examples

Follow one heap allocation through copy and move operations, then learn how value categories, special members, copy elision, and noexcept affect real C++ code.

Updated 25 Aug 20265 min readC++

Exception Handling in C++: try, catch, throw and two runnable examples

Follow two runnable programs to see how C++ exceptions change control flow, select handlers and destroy local objects during stack unwinding.

Updated 23 Aug 20266 min readC++

C++ Variables, Scope and Namespaces: Trace Name Lookup Across Three Files

Trace one C++ program across a header and two source files to see exactly how declaration, initialisation, scope, namespaces, lifetime and linkage differ.

Updated 22 Aug 20265 min readC++

C++ auto and decltype: Trace Every Deduced Type

Trace what C++ actually deduces when auto, references, const, decltype, and decltype(auto) interact, then confirm each result at compile time.

Updated 20 Aug 20266 min readC++

Lambda Expressions in C++: Syntax, Captures and Worked Examples

Learn how C++ lambdas store captured state, accept parameters and work with STL algorithms. Follow each example from creation to exact output.

Updated 18 Aug 20266 min readC++

Algorithms Header in C++: Sort, Search and Transform with Runnable Examples

Learn the iterator-range model behind C++ standard algorithms through complete programs for sorting, searching, transforming and erase-remove.

Updated 16 Aug 20267 min readC++