Slowly working through the text. Will update as I complete each section. See below for compiling instructions.
- 1.1 Writing a Simple C++ Program
- 1.2 A First Look at Input/Output
- 1.3 A Word about Comments
- 1.4 Flow of Control
- 1.4.1 The
whileStatement - 1.4.2 The
forStatement - 1.4.3 Reading an Unknown Number of Inputs
- 1.4.4 The
ifStatement
- 1.4.1 The
- 1.5 Introducing Classes
- 1.5.1 The
Sales_itemclass - 1.5.2 A First Look at Member Functions
- 1.5.1 The
- 1.6 The Bookstore Program
- 2.1 Primitive Built-in Types
- 2.1.1 Arithmetic Types
- 2.1.2 Type Conversions
- 2.1.3 Literals
- 2.2 Variables
- 2.2.1 Variable Definitions
- 2.2.2 Variable Declarations and Definitions
- 2.2.3 Identifiers
- 2.2.4 Scope of a Name
- 2.3 Compound Types
- 2.3.1 References
- 2.3.2 Pointers
- 2.3.3 Understanding Compound Type Declarations
- 2.4
constQualifier- 2.4.1 References to
const(Refer Textbook) - 2.4.2 Pointers to
const - 2.4.3 Top-Level
const - 2.4.4
constexprand Constant Expressions
- 2.4.1 References to
- 2.5 Dealing with Types
- 2.5.1 Type Aliases (Refer Textbook)
- 2.5.2 The
autoType Specifier - 2.5.3 The
decltypeType Specifier
- 2.6 Defining Our Own Data Structures
- 3.1 Namespace
usingDeclarations - 3.2 Library
stringType- 3.2.1 Defining and Initializing
strings(Refer Textbook) - 3.2.2 Operations on
strings - 3.2.3 Dealing with the characters in a
string
- 3.2.1 Defining and Initializing
- 3.3 Library
vectorType - 3.4 Introducing Iterators
- 3.4.1 Using iterators
- 3.4.2 Iterator Arithmetic
- 3.5 Arrays
- 3.6 Multidimensional Arrays
- 4.1 Fundamentals
- 4.1.1 Basic Concepts (Refer Textbook)
- 4.1.2 Precedence and Associativity
- 4.1.3 Order of Evaluation
- 4.2 Arithmetic Operations
- 4.3 Logical and Relational Operators
- 4.4 Assignment Operators
- 4.5 Increment and decrement Operators
- 4.6 The Member Access Operators
- 4.7 The Conditional Operator
- 4.8 The Bitwise Operators
- 4.9 The
sizeofOperator - 4.10 Comma Operator
- 4.11 Type Conversions
- 4.11.1 The Arithmetic Conversions
- 4.11.2 Other Implicit Conversions
- 4.11.3 Explicit Conversions
- 4.12 Operator Precedence Table (Refer Textbook)
- 5.1 Simple Statements
- 5.2 Statement Scope
- 5.3 Conditional Statements
- 5.3.1 The
ifStatement - 5.3.2 The switch Statement
- 5.3.1 The
- 5.4 Iterative Statements
- 5.4.1 The
whileStatement - 5.4.2 Traditional
forStatement - 5.4.3 Range
forStatement - 5.4.4 The
do whileStatement
- 5.4.1 The
- 5.5 Jump Statements
- 5.5.1 The
breakStatement - 5.5.2 The
continueStatement - 5.5.3 The
gotoStatement
- 5.5.1 The
- 5.6
tryBlocks and Exception Handling- 5.6.1 A
throwExpression - 5.6.2 The
tryBlock - 5.6.3 Standard Exceptions
- 5.6.1 A
- 6.1 Function Basics
- 6.1.1 Local Objects
- 6.1.2 Function Declarations
- 6.1.3 Separate Compilation
- 6.2 Argument Passing
- 6.3 Return Types and the
returnStatement - 6.4 Overloaded Functions
- 6.4.1 Overloading and Scope
- 6.5 Features for Specialized Uses
- 6.5.1 Default Arguments
- 6.5.2 Inline and
constexprFunctions - 6.5.3 Aids for Debugging
- 6.6 Function Matching
- 6.7 Pointers to Functions
- 7.1 Defining Abstract Data Types
- 7.2 Access Control and Encapsulation
- 7.2.1 Friends
- 7.3 Additional Class Features
- 7.3.1 Additional Class Features
- 7.3.2 Functions That Return
*this - 7.3.3 Class Types
- 7.3.4 Friendship Revisited
- 7.4 Class Scope
- 7.5 Constructors Revisited
- 7.5.1 Constructor Initializer List
- 7.5.2 Delegating Constructors
- 7.5.3 The Role of the Default Constructor
- 7.5.4 Implicit Class-Type Conversions
- 7.5.5 Aggregate Classes
- 7.5.6 Literal Classes
- 7.6
staticClass Members
Firstly install CMake, then, open up a terminal in the directory you wish to store the repository and clone it.
$ git clone https://github.com/adobrich/CppPrimer.git
Now cd into the repo, create the build directory and build the solutions.
$ cd CppPrimer
$ mkdir build
$ cd build
$ cmake ..
$ make
Executable files are in the newly created 'Chapter' folders in the build directory. Enjoy.
Refer to C++ Primer Errata if you notice any inconsistencies with your version of the text book.