Beginner to Pro · 24 lessons · Free

C++: Zero to Hero

Bite-sized lessons of 5–10 minutes. Run the examples, crush the challenge, stack up XP: one lesson at a time, from beginner to pro.

C++ progress0/24 lessons
Start learning, it's free
What is C++? Read the beginner's guide →Want to write your own code? Open the C++ compiler →
  1. MODULE 1

    C++ Basics

    cout, variables, string, cin and getline

    1. 1. Your First C++ Program#include <iostream>, cout and endl
    2. 2. Variables, auto and stringint, double, bool, char, string and auto
    3. 3. Input with cin and getlinecin >>, getline and setprecision
  2. MODULE 2

    Conditions and Loops

    if/else, switch, loops and patterns

    1. 1. Conditions: if, else and switchComparisons, &&, ||, ternary and switch
    2. 2. Loops: for, while and range-forLoops, break, continue and digit problems
    3. 3. Nested Loops: PatternsPyramid, number and character patterns
  3. MODULE 3

    Functions

    Overloading, default arguments, references and recursion

    1. 1. Functions, Default Arguments and OverloadingSame name, different parameters
    2. 2. References and Pass by ReferenceChange the caller's variable with int&, and const&
    3. 3. RecursionBase case, power and the Tower of Hanoi
  4. MODULE 4

    STL: The Standard Template Library

    vector, algorithms, string, map, set, stack and queue

    1. 1. vector: The Growable Arraypush_back, size, at and range-for
    2. 2. STL Algorithms: sort, reverse and find<algorithm> and <numeric>
    3. 3. The string Class and String Problemssubstr, find, replace, reverse and palindromes
    4. 4. map and unordered_mapKey-value storage and counting
    5. 5. set, stack, queue and priority_queueThe STL containers behind DSA
  5. MODULE 5

    Object-Oriented Programming (OOP)

    Classes, constructors, inheritance, virtual functions and operator overloading

    1. 1. Classes and ObjectsClasses, objects, public/private and methods
    2. 2. Constructors and DestructorsInitializer lists, overloaded constructors and ~destructors
    3. 3. InheritanceBase and derived classes, protected and constructor chaining
    4. 4. Virtual Functions and Polymorphismvirtual, override, pure virtual and abstract classes
    5. 5. Operator OverloadingTeach +, == and << to work with your class
  6. MODULE 6

    Modern C++ and a Project

    Smart pointers, lambdas, templates, exceptions and a mini project

    1. 1. Pointers, new/delete and Smart PointersHeap memory, unique_ptr and shared_ptr
    2. 2. Lambdas and Custom Sorting[](...) { }, captures and sorting with a comparator
    3. 3. Templates: Generic CodeOne piece of code for many types
    4. 4. Exceptions: try, catch and throwHandle errors safely
    5. 5. Mini Project: Inventory ManagementClasses, map, exceptions and sorting together