An Introductory Tutorial for Modern C++

This site contains an original, self-contained guide to learning the fundamentals of Modern C++, intended to be the basis of a self-study course. Some Chapters depend upon material presented in earlier ones, so studying them linearly is recommended. There are also regular posts (accessible from the front page) which cover topics or areas of C++ not covered in the course.

If you have any queries or suggestions, please leave a comment. The course materials are in a completed state (note: recently updated to cover some parts of C++23) and are made freely available here:

  1. About this Tutorial
  2. String and Character Literals
  3. Variables, Scopes and Namespaces
  4. Conditions and Operators
  5. Functions
  6. Arrays, Pointers and Loops
  7. Enums and Structs
  8. Strings, Containers and Views
  9. Files and Formatting
  10. Classes, Friends and Polymorphism
  11. Templates, Exceptions, Lambdas, Smart Pointers

Last update: 2024/01/22

6 thoughts on “An Introductory Tutorial for Modern C++”

    1. Hi,

      Sorry to hear you’re having difficulties. Please could you go into more detail about which code sample and which compiler/options you are using? Would like to resolve this for you, thanks.

      Like

  1. Thank you very much for your great tutorials! I found them to be very helpful.

    I have learned C and a bit of C++ more than 15 years ago but from 10 years ago I have been mostly a python programmer. Recently I wanted to learn the “modern” version of C++ again and have worked through all your 10 chapters. I think your tutorials provide an excellent overview of “modern” C++ features and allow me to get quickly up to speed 🙂

    Like

    1. Hi,

      Thanks so much for the feedback! I do keep an eye on the stats and traffic is increasing all of the time, however it’s great to hear that the tutorial has really been useful to someone. Also, well done for getting through all ten chapters!

      Like

    1. Yes, you are correct. C++23 changes the “Hello World” program to use std::format instead of iostream.

      Updating this part of the Tutorial would mean major changes to the chapter “Files and Formatting” were needed too. Due to interest in the site I would like to keep it up-to-date, so these changes are on my to-do list for 2024, pending widespread compiler/library support.

      Like

Leave a comment