Kodewick
C++ course · Beginner

Learn C++

Start with modern C++ straight away: string, vector and map, then classes, the life of an object and smart pointers. Every example runs on the page, and stepping shows how each variable and container changes.

Start with lesson 1 →30 lessons · about 8 hours · free · runs in your browser
  1. Part 1Getting startedcout, variables and auto, input, operators, string.5 lessons · 1.5 h
    1. Lesson 1Hello, World!15 minStart
    2. Lesson 2Variables, types and auto15 minStart
    3. Lesson 3Input15 minStart
    4. Lesson 4Operators15 minStart
    5. Lesson 5Strings15 minStart
  2. Part 2Control flow and functionsif, loops, functions, overloading, and references.5 lessons · 1.5 h
    1. Lesson 6if and switch15 minStart
    2. Lesson 7Loops15 minStart
    3. Lesson 8Functions15 minStart
    4. Lesson 9Overloading and default arguments15 minStart
    5. Lesson 10References15 minStart
  3. Part 3Containersvector, range-based for and common algorithms, map and set.4 lessons · 1 h
    1. Lesson 11vector15 minStart
    2. Lesson 12Range-based for and algorithms15 minStart
    3. Lesson 13map and set15 minStart
    4. Lesson 14pair, struct and enum class15 minStart
  4. Part 4ClassesClasses and objects, constructors and destructors, operator overloading, copy and move.4 lessons · 1 h
    1. Lesson 15Classes and objects15 minStart
    2. Lesson 16Constructors and destructors15 minStart
    3. Lesson 17Operator overloading15 minStart
    4. Lesson 18Copy and move15 minStart
  5. Part 5Memory and lambdasPointers, new and delete, smart pointers, lambdas.4 lessons · 1 h
    1. Lesson 19Pointers15 minStart
    2. Lesson 20new and delete15 minStart
    3. Lesson 21Smart pointers15 minStart
    4. Lesson 22Lambdas15 minStart
  6. Part 6Inheritance and templatesInheritance, virtual functions, templates and exceptions.4 lessons · 1 h
    1. Lesson 23InheritanceComing soon
    2. Lesson 24Virtual functions and polymorphismComing soon
    3. Lesson 25TemplatesComing soon
    4. Lesson 26Exceptions: try and catchComing soon
  7. Part 7Going furtherIterators, how a vector grows, a page for C programmers, and a small project.4 lessons · 1 h
    1. Lesson 27Iterators15 minStart
    2. Lesson 28How a vector grows, and invalid pointers15 minStart
    3. Lesson 29Coming from C15 minStart
    4. Lesson 30Project: a library20 minStart

Questions

Is it really free?

Yes. Every lesson, example and exercise is free, and there is no account to make.

Do I need to install a compiler?

No. The code compiles and runs in your browser with the same results as g++, and you can watch variables, containers and objects change one line at a time.

Is it real C++?

It is C++14, as g++ compiles it. Every example in the course is checked against g++, output and error messages included. The lessons on inheritance, virtual functions, templates and exceptions are still being prepared and come a little later.

Do I need to learn C first?

No. This course teaches modern C++ from the start: string and vector first, pointers later. If you know C, read the lesson Coming from C.

Can C++ be my first language?

Yes. Lesson 1 starts with cout, and each lesson uses only what came before. C++ has a lot of rules, though; if you have never coded, Python first makes it easier.

How long does it take?

Each lesson takes 15 to 20 minutes. One or two a day and you are done in about a month. Go slowly through classes and memory, and press Step a lot.

Can I learn on my phone?

Yes. Reading, running, stepping and the exercises all work on a phone; longer exercises are easier with a keyboard.

Where is my progress saved?

In this browser, with no account. On another device, or after clearing your browser data, it is gone.