OneCompiler

C++

A complete, hands-on introduction to modern C++. Learn the basics, functions, vectors, pointers, classes, templates and the standard library, with an exercise after every lesson.

11 sections·67 items·Beginner
This course includes
  • 67 practice problems
  • 67 lessons
  • Free — runs in your browser, no setup

What you'll learn

Write, compile and run C++ programs
Use variables, data types, operators and math functions
Control your program with conditions and loops
Write functions and pass values by reference
Work with arrays, strings, characters and vectors
Use pointers, dynamic memory and smart pointers
Build your own types with enums, structs, classes, inheritance and operator overloading
Write function and class templates
Use the standard library: pairs, maps, sets, unordered maps, stacks, queues, priority queues, iterators, algorithms, lambdas and exceptions

Syllabus

About this course

C++ is a programming language used where speed matters. Game engines, web browsers and many databases are written in C++. It gives you close control over the computer, like C, and adds tools that help you build large programs.

This course teaches modern C++ from the first line. You start with cout and variables, then learn conditions, loops and functions. After that come the parts that make C++ its own language: vectors, classes and templates. The last section covers the standard library tools that you will use in real programs and in coding interviews, such as maps, stacks, queues and algorithms. Each lesson is short and ends with an exercise. Almost every exercise is a program that you compile and run in the browser.

You don't need any programming experience. If you already know C, the first sections will feel familiar, and you can move through them quickly. The second half of the course is where C++ is different from C.