
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Explore C++ fundamentals and advanced topics through ten levels of hands-on exercises and theory guides, covering object oriented programming, templates, the STL, memory management, concurrency, and design patterns.
Learn how to perform basic input and output in C++ using cin and cout, with iostream and the main function, declaring int variables, and using semicolons to compile and run.
Explore variables and data types in C++, including int, unsigned, double, char, string, and bool, with and without initialization, and learn about warnings and uninitialized variables.
Explore arithmetic and logical operators in C++ by practicing int and double variables, casting for division, modulus, and boolean expressions in if statements.
Learn C++ conditional statements, including if, if else, and if else if else, using or, and, not to determine grades, age checks, and enrollment status.
Explore switch case versus if statements, with syntax, break behavior, and readability; switch works best for a small set of discrete values, while if suits ranges and many cases.
Learn how while loops and do-while loops control repeated execution in C++, with a number-guessing example that updates guesses and avoids infinite loops.
Learn to declare and use a for loop in C++, with initialization, condition, and increment, count from 1 to 10, with steps of 1 or 2, and explore inner ifs.
Learn to define and call C++ functions, including void ones with or without parameters, and functions that return values like get lucky number and add two ints in main.
Explore the differences between local and global variables in C++, noting that locals may be uninitialized and undefined, while globals default to zero and persist across functions.
Learn to manipulate strings in c++ by declaring a string, accessing characters with indices, using length and substr, and converting to uppercase with two upper and static cast ascii values.
Learn how to declare and initialize arrays in C++, index elements with zero-based positions, and access or modify values using for loops, while noting bounds and fixed size.
Explore C-style strings by declaring char arrays, understanding the null terminator, using strlen, comparing with strcmp, and performing copy and concatenation, contrasting with modern C++ strings.
Explore pointers in C++ by declaring int pointers, using address-of and dereference operators, and manipulating dynamic memory, arrays, and structures such as nodes in linked lists for performance.
Master dynamic memory in c++ by allocating on the heap with new, handling dynamic pointers, and freeing with delete. Allocate arrays with runtime size using delete[] to deallocate elements.
Compare pass-by-value and pass-by-reference in functions, showing how copying a parameter differs from using its address. Use value to keep main variables unchanged, use reference to allow changes.
Learn to use structures in C++ by defining a student struct with name, age, and grade, creating S1 and S2, and printing their fields to show grouped data.
Define a student structure with name, age, and grade, then create a three-element array and populate it with a for loop, accessing fields as student[i].name, student[i].age, and student[i].grade.
Learn how functions return pointers with heap memory, avoid returning the address of a local variable, and manage memory with new and delete for single values, arrays, and a student.
Explore encapsulation in C++ by learning how private attributes guard vehicle data and are modified only through public constructors, getters, and setters.
Explore constructors and destructors in object oriented programming, using a smart device class to create objects with a name and on/off status, and observe automatic destruction order.
explore default constructors, initialization lists, and best practices for initializing class attributes in c++, including switching from braces to initializer lists and avoiding parentheses in the default constructor.
Explore getters and setters to control brightness and other attributes through encapsulation. See how a smart lamp example uses a constructor, const getter, and a setter to manage brightness.
Explore method overloading in C++ by using a single add function with two ints, three ints, or two floats, showcasing the same name, different parameters, and return types.
Explore the this and const keywords in c++, showing how this references the current object and how const enforces no modification, with notes on operator overloading.
Explore how inheritance lets rectangle and circle derive from the base shape. See how color is shared, and how each class adds its own attributes, perimeter or area calculations.
Explore polymorphism in C++ by using a vehicle base class and derived car and track classes, with virtual and override display info, preventing slicing and enabling true polymorphic behavior.
We overload the plus operator for a complex number class to enable c1 plus c2 and return a new complex number. We also implement equality and a stream output.
Explore abstract classes in C++, learn how pure virtual functions and virtual destructors create a non-instantiable base, with concrete derived types like credit card payment and cash payment using polymorphism.
Explains inheritance with library member deriving from person and demonstrates composition by library containing book objects; shows constructors, display info, and range-based iteration to manage books.
Learn how static attributes and static functions share data across all contour instances, track total contours with a class-wide counter, and enforce that static functions cannot access non-static members.
Use dynamic_cast to safely downcast an animal pointer to a dog and invoke dog-specific fetch, while falling back to a generic animal sound when not a dog.
Learn to write data to a file using ofstream, including opening the file, creating it if needed, and writing text to example.txt.
Learn to read data from a file using ifstream and getline, displaying each line in the console with proper open checks and end-of-file handling.
Learn how to append data with fstream by combining out and append modes, opening a file to add lines and handle errors, and using bitwise operations to set modes.
Learn to use binary files in C++, writing and reading a student struct (name and age) with fstream in binary mode to save space and boost performance.
Learn how to serialize and deserialize an employee class to a binary file by writing and reading name, id, and salary, using size lengths, display, and constructors.
Discover the vector container—the most used STL component—demonstrating dynamic sizing, pushback, and range-based for printing, with comparisons to list, stack, queue, priority queue, and map.
Demonstrates regular, const, and reverse iterators in a vector of fruits, showing begin, end, and cbegin usage, modifying the first element to grape and iterating in reverse.
Compare list and vector in C++, show when to use list for push front and versatile inserts, and demonstrate iterators, insertions, and a display function.
The lecture introduces the stack container in c++, shows how to push and pop elements in a last in first out order, and explains display limitations and by-value copying.
Explore the queue data type and its fifo behavior, using front with push and pop. See a doctor queue example and a while loop that processes items in order.
Compare the priority queue with a queue, push elements by value, observe why higher values appear first, and use top and pop to manage the highest priority element.
Learn to build a priority queue by defining a task with name and priority, overload the comparison operator to order by priority, then push, top, and pop to process tasks.
Explore maps as key-value stores using unordered_map for fast lookups with string keys (countries) and int values (populations); iterate with a range-based for to read or update entries.
Explore lambda expressions in C++ with vectors, using a stateless lambda to identify even numbers in a vector of 3, 7, 2, 9, 4, and preview algorithm or iterator topics.
Demonstrate lambda expressions with C++ algorithms and iterators on a vector. Use for_each, sort, find_if, and a stateful filter to print, sort in descending order, and identify odd numbers.
Master function templates with a single swap values function that works for int, double, bool, and string via template type T, using by reference or by value.
Learn how to implement a generic class template with a template type T, featuring a two-value constructor and a display method. See int and string examples and tpp linkage.
Explore operator overloading in a class template for complex numbers, using a template type T to support int and double data types, with a plus operator, constructor, and display function.
Explore metaprogramming in C++, calculating the greatest common divisor at compile time using templates and static constants, and compare with the runtime version to see identical results.
Learn how C++20 concepts constrain templates with type checks like is_arithmetic for int, float, double, bool, and char, use a templated add function, and enforce compile-time correctness.
Explore dynamic arrays in c++ by using a create array function that returns a pointer, allocates heap memory, stores values, and frees memory with delete[].
Learn how inline and constexpr boost code quality by enabling const returns and compile-time calculations, and by using inline for simple functions like add, as shown in the area example.
Explore how a custom allocator assigns fixed memory sizes to subsystems like audio, graphics, and physics to boost performance. See static allocate and deallocate functions using operator new or malloc.
explains object pooling using a widget pool, acquire and release, and memory reuse. shows empty pool, one and two preallocated spaces, queue-based management, and destructor cleanup.
Explore asynchronous execution between input and output using a mutex, condition_variable, lock_guard, and unique_lock to protect shared data (data_ready) and coordinate two threads with wait and notify one.
Explains how promise and future work together to transfer ownership, share state, and synchronize value delivery, using a square computation example and a five-second simulated delay.
Explore the singleton design pattern by implementing a thread-safe database connection with a private constructor, static getInstance, and mutex to ensure a single instance and controlled access.
Master the factory design pattern in C++ by centralizing object creation with a car factory that returns sedan or SUV and uses a polymorphic car interface.
Master the strategy design pattern with a payment strategy example that switches between credit card and PayPal, using a payment context and shared pointers for polymorphic execution.
Explore the observer design pattern by implementing a weather station with a single or multiple observers, where temperature updates notify displays via a virtual update method.
Explore advanced error handling in C++ through a custom sensor exception class, with initialization checks and a read failure simulated every third read, handled via try-catch.
100 C++ Coding Challenges: Practice, Improve, Master! is a comprehensive, hands-on course designed to take you from a complete beginner to an advanced C++ programmer. Whether you're a student, aspiring developer, or a professional looking to sharpen your C++ skills, this course offers a structured and practical path to mastering modern C++ through 100 carefully crafted coding challenges.
The course is divided into 10 progressive levels, covering everything from the basics of input/output, variables, and control structures (C++98/C++03), to more advanced concepts like pointers, object-oriented programming, STL, templates, file handling, multithreading, and design patterns (C++11–C++20).
Each session includes a clear theory guide, followed by real-world exercises and mini-projects that reinforce the concepts in a meaningful and applied way. You’ll build everything from a basic calculator and student gradebook to a multithreaded restaurant simulation and a stock trading dashboard using design patterns.
By the end of this course, you'll have solved 100+ coding exercises, built reusable C++ systems, and developed a solid portfolio of projects. Most importantly, you'll gain the confidence to tackle interviews, technical tests, and real-world software challenges with modern C++.
No prior experience is required—just your motivation to learn, solve problems, and become fluent in one of the most powerful programming languages in the world.