How to learn C++

Learning C++ means learning a compiled language: you write source files, a compiler checks and translates them, and a linker builds the program. Start with a free tutorial and a compiler, and master four basics:

A dark screen with colorful source code and a column of line numbers
A source file in a dark editor, where the compiler's first error will appear.Photo: kuszapro / Pixabay
  1. 1

    A compiler

    It checks your code and translates it.

  2. 2

    Compile errors

    Read the line number and the message.

  3. 3

    Types and variables

    int, double, bool, std::string.

  4. 4

    Small programs

    One concept at a time.

Learn in Evernote. Clip the docs, let the AI Assistant fix your code, and search any snippet.

Start your coding notebook in Evernote

How to learn C++ in 6 steps

  1. 1

    Pick a free tutorial

    Learn C++ (learncpp.com) is a free, step-by-step tutorial that starts with an introduction to C++ and how programs are built.

  2. 2

    Understand compiling and linking

    The compiler checks that your code follows the rules of C++ and turns each .cpp file into an object file; the linker combines them into a program.

  3. 3

    Install a compiler and write Hello, world

    Use a C++ compiler or an IDE that includes one. Compile, run, then change the message.

  4. 4

    Read every compile error

    The compiler gives an error and a line number when code breaks the rules, like a missing semicolon. Fix the first error, then compile again.

  5. 5

    Learn the basics in order

    Variables and types, input and output, if, loops, functions, then arrays and vectors.

  6. 6

    Build small programs

    A grade calculator, a number game, a text menu. Add one concept per program.

A 4-week C++ plan

About 30 minutes a day, following Learn C++
  1. 2Week 1How programs are built: compiler, linker, libraries. Install a compiler.
  2. 4Week 2Hello, world. Break it three ways and read each compile error.
  3. 5Week 3Variables, types, if and for loops.
  4. 6Week 4Project: a grade calculator with a function and a loop.

Free coding practice log

One entry per session. Copy it, or save it to your Evernote account and keep your snippets in the same note.

Date: [day] · Time spent: [minutes]

Topic: [one concept, like for loops or functions]

Source: [tutorial, chapter or video, with its link]

What I built: [a small program, in one line]

Error I hit: [the last line of the error message]

How I fixed it: [one sentence, plus the corrected snippet]

Next session: [the next concept to learn]

Trusted by Millions Worldwide

4.4

2,100+ reviews on G2

4.4

8,200+ reviews on Capterra

4.4

73,000+ reviews on App Store

248M

Registered users

C++ learning questions

Can I learn C++ for free?

Yes. Learn C++ (learncpp.com) is a free tutorial, and C++ compilers are available for many different operating systems.

Is C++ hard for beginners?

C++ asks you to compile your code and to declare types. Learn C++ introduces how a program is built early, so you meet those steps one at a time.

What is a compiler?

A program that checks your C++ code against the rules of the language and translates it into machine instructions, stored in object files.

What does the linker do?

It combines the object files and libraries into the final program, and makes sure code used across files is connected.

Should I learn C before C++?

Learn C++ starts with an introduction to C++ and how a program is built, so you can follow it from the beginning.

What can I build with C++?

Games, desktop apps, tools and programs where speed matters. Start with small console programs.

How to learn C++ with Evernote

Keep one notebook for C++: the tutorial pages you clip, your practice code, and every compile error you fixed.

  1. 1

    Clip the loops lesson.

    Save the loops lesson with the Web Clipper. Keep it in a notebook called Learning C++, with the loop example and the lesson link.

  2. 2

    Ask why it will not compile.

    Put Hello, world and its compile error in a note. Ask the AI Assistant why the statement needs a semicolon, and accept the fixed line.

  3. 3

    Find cout again.

    Search for "cout" when you need the output syntax again. Evernote finds it in your learncpp clip and in the practice note, code blocks included.

  • You can also ask the Assistant for a practice task that repeats every day.
  • You can also save screenshots of error messages, and search finds the words in them.

Every snippet, error and fix in one place

Clip the docs you learn from, ask the AI Assistant why your code breaks, and find any snippet again by searching for it.

Start for free