# C++ Programming & Systems Engineering

> A complete curriculum from modern C++ language fundamentals to memory management, pointers, references, STL internals, and high-performance engineering.

- Canonical URL: https://shafinchowdhury.dev/topics/cpp/
- Author: Shafin Chowdhury (https://shafinchowdhury.dev/about/)

C++ gives software engineers direct control over memory, hardware resources, and computational performance. This topic hub provides a comprehensive roadmap starting from foundational variables, streams, and control flow, through pointers and const correctness, up to dynamic heap mechanics and STL container internals.

## Curated Learning Path

1. **[Beginner]** [C++ Variables and Data Types](https://shafinchowdhury.dev/posts/cpp-variables-and-data-types/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-variables-and-data-types.md)) — Memory representation, primitive types, modifiers, sizeof inspections, and static_cast.
2. **[Beginner]** [Input and Output in C++](https://shafinchowdhury.dev/posts/cpp-input-and-output/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-input-and-output.md)) — Standard streams (cin, cout, cerr), newline performance, multi-word getline, and iomanip formatting.
3. **[Beginner]** [C++ Operators & Precedence](https://shafinchowdhury.dev/posts/cpp-operators/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-operators.md)) — Arithmetic, logical, bitwise masking, prefix vs postfix increment, and short-circuit evaluation.
4. **[Beginner]** [Conditional Statements & Branching](https://shafinchowdhury.dev/posts/cpp-conditional-statements/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-conditional-statements.md)) — Decision-making with if-else, modern C++17 init-statements, switch cases, and fallthrough rules.
5. **[Beginner]** [Loops & Iteration in C++](https://shafinchowdhury.dev/posts/cpp-loops/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-loops.md)) — for, while, do-while, modern range-based loops, break, continue, and matrix nesting.
6. **[Beginner]** [Functions, Scope, and Prototypes](https://shafinchowdhury.dev/posts/cpp-functions/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-functions.md)) — Modular architecture, function signatures, prototypes, default arguments, overloading, and pass-by-value.
7. **[Beginner]** [Namespaces & Scope Resolution](https://shafinchowdhury.dev/posts/cpp-namespaces/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-namespaces.md)) — Preventing name collisions, the scope resolution operator (::), using declarations vs directives, and anonymous namespaces.
8. **[Beginner]** [Arrays & Memory Layout](https://shafinchowdhury.dev/posts/cpp-arrays/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-arrays.md)) — Contiguous memory layouts, zero-based indexing offsets, array decay, and modern std::array.
9. **[Beginner]** [Strings: std::string vs C-Strings](https://shafinchowdhury.dev/posts/cpp-strings/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-strings.md)) — Dynamic string management, character indexing, concatenation, substring slicing, and find.
10. **[Intermediate]** [Pointers & Memory Addresses](https://shafinchowdhury.dev/posts/cpp-pointers/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-pointers.md)) — Address-of operator, dereferencing, nullptr, pointer arithmetic, and heap basics with new and delete.
11. **[Intermediate]** [References & Aliases](https://shafinchowdhury.dev/posts/cpp-references/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-references.md)) — Direct aliases, immutable bindings, const references, temporary binding, and reference vs pointer comparisons.
12. **[Intermediate]** [Pass by Value vs Pass by Reference](https://shafinchowdhury.dev/posts/cpp-pass-by-value-vs-pass-by-reference/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-pass-by-value-vs-pass-by-reference.md)) — Call stack mechanics, CPU hardware registers, const T& read-only performance, and parameter decision trees.
13. **[Intermediate]** [const Correctness & constexpr](https://shafinchowdhury.dev/posts/cpp-const/) ([Markdown](https://shafinchowdhury.dev/posts/cpp-const.md)) — Immutability contracts, decoding pointer constness variations, const member functions, and compile-time constexpr.
14. **[Intermediate]** [Dynamic Memory Allocation & Heap Mechanics](https://shafinchowdhury.dev/posts/dynamic-memory-allocation/) ([Markdown](https://shafinchowdhury.dev/posts/dynamic-memory-allocation.md)) — Deep dive into heap lifecycle, raw new/delete allocation patterns, memory leaks, and segmentation faults.
15. **[Advanced]** [Mastering std::list & STL Linked Containers](https://shafinchowdhury.dev/posts/list-in-cpp/) ([Markdown](https://shafinchowdhury.dev/posts/list-in-cpp.md)) — Doubly-linked node architecture, iterator invalidation rules, and cache-locality trade-offs.
16. **[Advanced]** [Algorithmic Optimization & Raw Arithmetic](https://shafinchowdhury.dev/posts/efficient-palindrome-code/) ([Markdown](https://shafinchowdhury.dev/posts/efficient-palindrome-code.md)) — Eliminating memory allocation overhead and replacing string conversions with arithmetic digit operations.

## Articles by Category

### Language Basics & Control Flow

Core syntax, data types, stream I/O, operators, conditionals, and iteration.

- [C++ Variables and Data Types: A Complete Beginner's Guide](https://shafinchowdhury.dev/posts/cpp-variables-and-data-types/): Master variables and fundamental data types in modern C++. Understand memory representation, primitive types, modifiers, type casting with static_cast, and scope rules. ([Markdown](https://shafinchowdhury.dev/posts/cpp-variables-and-data-types.md))
- [C++ Input and Output: cin, cout, getline, and Stream Formatting](https://shafinchowdhury.dev/posts/cpp-input-and-output/): A complete guide to standard I/O streams in modern C++. Master cin, cout, cerr, endl vs newline, reading multi-word strings with getline, and formatting with iomanip. ([Markdown](https://shafinchowdhury.dev/posts/cpp-input-and-output.md))
- [C++ Operators: Arithmetic, Logical, Bitwise, and Precedence Explained](https://shafinchowdhury.dev/posts/cpp-operators/): A comprehensive guide to C++ operators. Understand arithmetic, assignment, relational, logical, bitwise, and ternary operators, along with precedence and short-circuit evaluation. ([Markdown](https://shafinchowdhury.dev/posts/cpp-operators.md))
- [Conditional Statements in C++: if, else if, else, and switch](https://shafinchowdhury.dev/posts/cpp-conditional-statements/): Master decision-making in C++. Learn if, else if, else, switch-case, modern C++17 init-statements, fallthrough rules, and how to write clean branching logic. ([Markdown](https://shafinchowdhury.dev/posts/cpp-conditional-statements.md))
- [Loops in C++: for, while, do-while, and Range-Based Iteration](https://shafinchowdhury.dev/posts/cpp-loops/): Master iteration in C++. Learn for loops, while loops, do-while loops, range-based for loops, loop control with break and continue, and how to avoid infinite loops. ([Markdown](https://shafinchowdhury.dev/posts/cpp-loops.md))

### Modular Code & Data Sequences

Function prototypes, namespaces, stack frames, fixed-size arrays, and dynamic strings.

- [Functions in C++: Declaration, Scope, Overloading, and Parameters](https://shafinchowdhury.dev/posts/cpp-functions/): Master modular programming in C++. Learn function prototypes, definitions, return types, default arguments, function overloading, pass-by-value, and recursion. ([Markdown](https://shafinchowdhury.dev/posts/cpp-functions.md))
- [Namespaces in C++: Scope Resolution, Name Collisions, and Best Practices](https://shafinchowdhury.dev/posts/cpp-namespaces/): Understand namespaces in C++ the easy way. Learn how to prevent name collisions, use the scope resolution operator (::), navigate nested and anonymous namespaces, and why 'using namespace std;' is dangerous in headers. ([Markdown](https://shafinchowdhury.dev/posts/cpp-namespaces.md))
- [Arrays in C++: Memory Layout, Indexing, and Modern Alternatives](https://shafinchowdhury.dev/posts/cpp-arrays/): A complete guide to arrays in C++. Understand contiguous memory layouts, zero-based indexing, multidimensional arrays, array decay in functions, and std::array. ([Markdown](https://shafinchowdhury.dev/posts/cpp-arrays.md))
- [Strings in C++: std::string vs C-Style Strings and Practical Operations](https://shafinchowdhury.dev/posts/cpp-strings/): Master string manipulation in C++. Compare modern std::string with legacy C-style char arrays, learn concatenation, searching, slicing with substr, and input handling. ([Markdown](https://shafinchowdhury.dev/posts/cpp-strings.md))

### Pointers, References & Const Correctness

Memory addresses, dereferencing, aliases, zero-copy parameter passing, and immutability.

- [Pointers in C++: Memory Addresses, Dereferencing, and Heap Basics](https://shafinchowdhury.dev/posts/cpp-pointers/): A comprehensive guide to pointers in modern C++. Understand memory addresses, dereferencing, nullptr, pointer arithmetic, dynamic heap allocation, and memory safety. ([Markdown](https://shafinchowdhury.dev/posts/cpp-pointers.md))
- [References in C++: Aliases, Memory Mechanics, and Pointers Compared](https://shafinchowdhury.dev/posts/cpp-references/): Master C++ references. Learn how aliases operate in memory, const reference binding, reference vs pointer trade-offs, and how to avoid dangling references. ([Markdown](https://shafinchowdhury.dev/posts/cpp-references.md))
- [Pass by Value vs Pass by Reference in C++: Performance and Mechanics](https://shafinchowdhury.dev/posts/cpp-pass-by-value-vs-pass-by-reference/): Pass by value vs pass by reference in C++: a copy versus the caller's own variable. Learn when to use T, T&, const T& or a pointer, with examples. ([Markdown](https://shafinchowdhury.dev/posts/cpp-pass-by-value-vs-pass-by-reference.md))
- [const in C++: Constants, const Pointers, References, and constexpr](https://shafinchowdhury.dev/posts/cpp-const/): Master const correctness in modern C++. Understand const variables, const references, pointer constness variations, const member functions, and constexpr. ([Markdown](https://shafinchowdhury.dev/posts/cpp-const.md))

### Systems Architecture, Dynamic Memory & STL

Heap allocation, doubly-linked node containers, and low-overhead algorithmic performance.

- [Dynamic Memory Allocation](https://shafinchowdhury.dev/posts/dynamic-memory-allocation/): Dynamic memory allocation in C explained: how malloc(), calloc(), realloc() and free() from <stdlib.h> work, with syntax and runnable code examples. ([Markdown](https://shafinchowdhury.dev/posts/dynamic-memory-allocation.md))
- [Mastering std::list in Modern C++: From Architecture to Production-Ready Code](https://shafinchowdhury.dev/posts/list-in-cpp/): This guide explains how std::list works like a chain of nodes linked together in memory. It uses simple steps and clear code examples to show how to add, find, update, and delete items using modern C++ features. Lastly, it shares easy tips on when to use this container and how to avoid mistakes that slow down your program. ([Markdown](https://shafinchowdhury.dev/posts/list-in-cpp.md))
- [How I Cut My Palindrome Algorithm’s Execution Time in Half](https://shafinchowdhury.dev/posts/efficient-palindrome-code/): A student-friendly guide to writing highly efficient palindrome functions in C++. Move from slow string conversions to a raw arithmetic method that speeds up your code by 200%. ([Markdown](https://shafinchowdhury.dev/posts/efficient-palindrome-code.md))
