An attempt at a C++ tutorial.
Switch branches/tags
Nothing to show
Clone or download
jesyspa Merge pull request #3 from michaelrbock/patch-1
Fix small typo in expression.hpp
Latest commit 8d9f3ff Jul 5, 2017
Permalink
Failed to load latest commit information.
Chapter 00 - Foreword Wrote about structs. Sep 8, 2013
Chapter 01 - Hello World Wrote about structs. Sep 8, 2013
Chapter 02 - Types and Variables Editing. Sep 5, 2013
Chapter 03 - If Minor editing and a chapter on functions. Sep 2, 2013
Chapter 04 - While Minor editing and a chapter on functions. Sep 2, 2013
Chapter 05 - Vectors Editing. Sep 5, 2013
Chapter 06 - For Minor editing and a chapter on functions. Sep 2, 2013
Chapter 07 - Functions Incorporated masonk's suggestions. Sep 5, 2013
Chapter 08 - Using Multiple Files Wrote about templates! Sep 4, 2013
Chapter 09 - Iterators Got rid of return 0 in some mains. Sep 3, 2013
Chapter 10 - References Added missing include. Jun 26, 2014
Chapter 11 - Standard Algorithms Added some missing includes. Sep 4, 2013
Chapter 12 - Function Templates Incorporated masonk's suggestions. Sep 5, 2013
Chapter 13 - Exceptions Rewrote end of exceptions. Sep 5, 2013
Chapter 14 - Project Overview Wrote about structs. Sep 8, 2013
Chapter 15 - Basic Structs Wrote about structs. Sep 8, 2013
Chapter 16 - Basic Operator Overloading Fixed header guards. May 25, 2014
Chapter 17 - Member Functions Minor fixes. Dec 29, 2013
Chapter 18 - Recursion Fix small type in ch18/parser.cpp Jul 4, 2017
Chapter 19 - Inheritance Fix small typo in expression.hpp Jul 3, 2017
Chapter 20 - Function Objects Wrote out code for new chapter. May 25, 2014
.gitignore Wrote about recursive parsing. Oct 19, 2013
README.md Updated README. May 19, 2014

README.md

Linear C++

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

Downloads:

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

Building

Via a bash shell, compiling all chapters:

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

On OSX:

  • 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?)