beginner · cpp

C++ Core Concepts in Practice

A compact refresher on the C++ concepts most useful in second-year programming and data-structures courses. Learners revisit memory, object-oriented design, generic programming, and STL usage through code reading, debugging, and focused reasoning.

What you could build

  • A browser-based expression evaluator to help me inspect program state
  • A browser-based inventory index to help me compare lookup strategies
  • A pointer-safe contact index I can query from the terminal
  • A memory-backed task queue I can inspect from the terminal
  • A maze game with pointer-based movement and collectible objects
  • A card-matching game with polymorphic cards and score rules

You pick the project at the start — these are examples, not a fixed list.

What you'll be able to do

  • Trace C++ expressions, variable scopes, function calls, parameter passing, and return values to determine a program's behavior.
  • Identify invalid pointer use, out-of-bounds access, dangling references, and incorrect object lifetimes, then explain why they fail.
  • Predict how constructors, destructors, copying, const qualification, inheritance, and dynamic dispatch affect C++ objects.
  • Choose STL containers and algorithms by matching their access patterns, ordering, uniqueness, iterator behavior, and asymptotic performance.
  • Trace function-template deduction and iterator-based algorithms to predict results and changes to underlying elements.

Who this is for

This course is for learners who have already written basic C++ programs and want a focused refresher before or during second-year programming and data-structures study. It fits anyone who can follow simple syntax but wants stronger confidence reading, debugging, and reasoning about memory, classes, templates, and the STL.

What you should already know

  • Basic programming experience with variables, conditionals, loops, functions, and parameter passing.
  • Enough C++ familiarity to read and compile short programs, including declarations, classes, and standard input/output.
  • Basic exposure to data structures such as arrays, linked structures, stacks, queues, or associative collections.

How a lesson actually goes

Lesson 1
TutorWelcome to C++ Core Concepts in Practice. We will focus on tracing and explaining code rather than memorizing rules. We will begin with variable types and scope, then use that foundation to reason about memory, objects, and the STL. Before we start, what feels least certain when you read C++ code?
YouI can usually follow the statements, but scope is confusing. I know a variable inside a function is local, though I sometimes lose track of whether a variable in a block is still available afterward.
TutorThat is a useful starting point. Let us focus only on block scope first. Consider: int total = 3; { int extra = 2; total += extra; }. Which names are accessible after the closing brace, and what is total's value?
Youtotal should be 5 because it was declared before the block. I think extra might also still exist because it was used to change total, but I am not completely sure.
Tutortotal is accessible and has value 5. extra is not accessible after the brace: its scope ends at the closing brace, even though its value was used to update another object. A useful distinction is that changing an outer variable does not extend the inner variable's scope; next, we can test the same rule with a nested block that redeclares a name.

Written from this course's first lesson to show the format — not a recording of a real session.

Course content

marks each module's capstone lesson.

01Language Essentials4 lessons

This module refreshes the C++ language foundations needed for later work: declaring and reasoning about values, evaluating expressions, and tracing control flow through functions.

  • Course Introduction

    Welcome and orientation to a compact C++ refresher focused on memory, object-oriented design, generic programming, and STL usage. The course uses code reading, debugging, and focused reasoning to prepare you for advanced programming and data-structures study.

  • Types, Variables, and Scope

    Review fundamental and user-defined type distinctions, declarations, initialization, constness, and the relationship between variables and their scopes. Practice predicting which declarations are visible and how type choices affect valid operations.

  • Expressions and Operators

    Refresh arithmetic, comparison, logical, assignment, increment, and conditional operators, with attention to the types and values they produce. Trace nontrivial expressions without confusing evaluation order, implicit conversion, and precedence.

  • Control Flow and Functions

    Synthesize the language essentials by reasoning through conditional and iterative control flow alongside function declarations, calls, parameters, and returns. Assessment focuses on predicting execution, identifying scope and type effects, and explaining how expressions determine control decisions.

02Memory and Indirection4 lessons

Refresh how C++ names, accesses, allocates, and releases objects in memory. Learners progress from references and pointers through array addressing and dynamic lifetime, then synthesize these ideas to diagnose memory-safety problems.

  • References and Pointers

    Review references as aliases and pointers as objects that store addresses, including initialization, null pointers, dereferencing, and the address-of operator. Use short code traces to determine which object an expression accesses.

  • Arrays and Pointer Arithmetic

    Connect built-in arrays, indexing, and pointers through the equivalence between a[i] and *(a + i) in valid expressions. Determine how pointer increments and differences relate to element positions, and identify when an address falls outside the array's valid access range.

  • Dynamic Memory and Lifetime

    Examine how new creates dynamically allocated objects or arrays and how delete or delete[] ends their lifetimes. Reason about the difference between an address stored in a pointer and the lifetime of the object at that address.

  • Memory Safety Reasoning

    Synthesize references, pointers, pointer arithmetic, and dynamic lifetime to trace memory states and classify failures such as null dereferences, out-of-bounds access, use-after-delete, and mismatched deallocation. Justify whether each access is valid and explain the reasoning from object lifetime and bounds.

03Object-Oriented Design4 lessons

This module refreshes how C++ models objects through classes, controls object state, manages construction and copying, and preserves interface guarantees with constness and parameter passing. Learners then trace inheritance and dynamic dispatch while synthesizing object lifetime, copying, and polymorphic behavior.

  • Classes and Encapsulation

    Review class definitions, data members, member functions, and the distinction between an object's interface and its representation. Trace how public, private, and protected access affect which code can inspect or modify an object's state.

  • Constructors, Destructors, and Copying

    Reason about when constructors and destructors run and how copying creates or assigns object state. Distinguish copy construction from copy assignment and connect each operation to the lifetime of the objects involved.

  • Constness and Parameter Passing

    Analyze const objects, const member functions, and const references as guarantees about permitted modification. Compare pass-by-value, pass-by-reference, and pass-by-pointer by tracing aliasing, copying, and whether a function can change the caller's object.

  • Inheritance and Dynamic Dispatch

    Synthesize class interfaces, object construction and copying, constness, and parameter passing with inheritance and dynamic dispatch. Analyze base and derived objects through references or pointers, including the role of virtual functions and virtual destructors in safe polymorphic use.

04Generic STL Reasoning4 lessons

This module refreshes generic programming and the Standard Template Library through focused reasoning about function templates, container capabilities, iterator-based algorithms, and performance trade-offs. Learners progress from reading template code to selecting and evaluating STL data structures in unfamiliar C++ code.

  • Function Templates

    Function templates define type-independent operations that the compiler specializes for particular arguments. Learners reason about template parameters, deduction, explicit type arguments, and how the resulting types affect overload behavior and expressions.

  • STL Container Selection

    STL containers provide different guarantees for storage, access, insertion, removal, ordering, and key lookup. Learners compare those guarantees to determine which container fits a stated set of operations.

  • Iterators and Algorithms

    Iterators provide a common way to traverse ranges, while STL algorithms operate on those ranges without depending on a particular container. Learners reason about half-open ranges, iterator categories, algorithm preconditions, return iterators, and element mutation.

  • STL Performance and Data-Structure Choices

    This synthesis assessment combines template reasoning, container selection, iterator-based algorithms, and complexity analysis. Learners diagnose mismatches between required behavior and chosen STL components, then compare alternatives by access, update, lookup, traversal, and invalidation costs.

Questions

Is this a beginner's course for learning C++ from scratch?

No. It is a compact refresher for learners who already know basic programming and can read simple C++ code. The focus is on reasoning through core language behavior rather than introducing programming fundamentals.

Will I learn pointers and dynamic memory in enough detail to debug them?

You will trace references, pointers, array indexing, pointer arithmetic, allocation, deallocation, and object lifetime. The memory-safety lessons use short code examples to identify and correct invalid access patterns.

Does the course cover object-oriented C++ beyond basic classes?

Yes. It covers encapsulation, access control, constructors, destructors, copying, constness, parameter-passing modes, inheritance, and dynamic dispatch.

Which parts of the STL are included?

The course focuses on function templates, container selection, iterators, algorithms, and performance-oriented data-structure choices. You will reason about operations, ordering, uniqueness, access patterns, iterator ranges, and asymptotic costs.

How is the one-on-one AI tutoring used?

The tutor guides you through code-reading and debugging questions, checks your reasoning, asks follow-up questions when an explanation is incomplete, and adjusts examples to the specific misconception you show.

The first lesson is ten minutes away.

Free while codeset is early. You choose what you're building before the first lesson starts, and the course is taught around it.

Start this course

Other courses