Skip to content
An attempt at a C++ tutorial.
Branch: master
Clone or download
Pull request Compare This branch is 4 commits behind jesyspa:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Chapter 00 - Foreword
Chapter 01 - Hello World
Chapter 02 - Types and Variables
Chapter 03 - If
Chapter 04 - While
Chapter 05 - Vectors
Chapter 06 - For
Chapter 07 - Functions
Chapter 08 - Using Multiple Files
Chapter 09 - Iterators
Chapter 10 - References
Chapter 11 - Standard Algorithms
Chapter 12 - Function Templates
Chapter 13 - Exceptions
Chapter 14 - Project Overview
Chapter 15 - Basic Structs
Chapter 16 - Basic Operator Overloading
Chapter 17 - Member Functions
Chapter 18 - Recursion
Chapter 19 - Inheritance
Chapter 20 - Function Objects

Linear C++

A C++ tutorial that can (hopefully?) be followed without jumping from chapter to chapter at every step.


I'll look into making MinGW Code::Block projects sometimes soon.


Via a bash shell, compiling all chapters:

for a in Chapter*; do g++ -std=c++11 -o "$a/out" "$a"/*.cpp; done


  • You must install XCode and the Command Line Tools package. As of 9/04/2013, Mac OS X doesn't ship with a C++11 compiler.
  • Then use clang to build:
for a in Chapter*; do clang++ --std=c++11 --stdlib=libc++ "$a"/*.cpp -o "$a"/out; done

Also, when compiling your own files on either of those two platforms, I recommend you add -Wall and -Wextra to your flags. Clang users may also want to add -fsanitize=undefined.

Future plans

Outline of what's coming:

  • Soon: Enums, More Inheritance, Unions and Variants, Practical Examples
  • Unplaced - Casting, Scope, Storage Duration, Undefined Behaviour, Volatile, Metaprogramming, Boost, C++14, File IO, Optional
  • Appendices - Declaration Syntax, Pointers to Members, Switch, The Preprocessor

Other plans:

  • Exercises!
  • Generating more human-readable files from the tutorials (or the other way around?)
You can’t perform that action at this time.