What is C++, why it still matters in 2024, and how to write, compile, and run your very first program. Covers environment setup with g++ and VS Code, the anatomy of a minimal program, and how the compiler turns source code into an executable.
An eight-part beginner-friendly journey through C++: from writing your first program and understanding variables, through control flow, functions, and arrays, to the heart of C++ — pointers, classes, inheritance, and polymorphism. Each article is self-contained and builds on the previous, giving you both a quick reference and a progressive path to mastery.
What is C++, why it still matters in 2024, and how to write, compile, and run your very first program. Covers environment setup with g++ and VS Code, the anatomy of a minimal program, and how the compiler turns source code into an executable.
Explore C++'s fundamental data types — int, float, double, char, and bool — plus how to declare variables, use constants, and apply arithmetic, comparison, and logical operators. Includes a detailed look at type conversion and the sizeof operator.
Learn how to make decisions in C++ with if/else and switch statements, and how to repeat code with for, while, and do-while loops. Covers nested loops, break, continue, and the ternary operator, with practical examples including a grade calculator and FizzBuzz.
Break your programs into reusable, testable pieces with C++ functions. Covers declaration vs definition, parameters and return values, pass-by-value vs pass-by-reference, default parameters, function overloading, and an introduction to recursion.
Work with collections of data in C++. Covers C-style arrays and their pitfalls, std::array for fixed-size collections, std::string and its most useful methods, and std::vector — the dynamically resizable container you'll use in almost every program.
Pointers are the most misunderstood part of C++ — and the key to understanding how memory actually works. This guide demystifies them from scratch: addresses, dereferencing, pointer arithmetic, dynamic allocation with new/delete, and how smart pointers make memory safe.
Object-oriented programming lets you model the real world as objects with data and behavior. This article covers C++ classes from the ground up: member variables, member functions, constructors, destructors, access specifiers, and the principle of encapsulation — with a full BankAccount example.
Inheritance lets you build new classes on top of existing ones, reusing and extending behaviour. Polymorphism lets a single interface work with many different types at runtime. Together they're the core of OOP in C++. This article covers base and derived classes, virtual functions, abstract classes, and when to use each pattern.