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
while
Statement - 1.4.2 The
for
Statement - 1.4.3 Reading an Unknown Number of Inputs
- 1.4.4 The
if
Statement
- 1.4.1 The
- 1.5 Introducing Classes
- 1.5.1 The
Sales_item
class - 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
const
Qualifier- 2.4.1 References to
const
(Refer Textbook) - 2.4.2 Pointers to
const
- 2.4.3 Top-Level
const
- 2.4.4
constexpr
and Constant Expressions
- 2.4.1 References to
- 2.5 Dealing with Types
- 2.5.1 Type Aliases (Refer Textbook)
- 2.5.2 The
auto
Type Specifier - 2.5.3 The
decltype
Type Specifier
- 2.6 Defining Our Own Data Structures
- 3.1 Namespace
using
Declarations - 3.2 Library
string
Type- 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
vector
Type - 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
sizeof
Operator - 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
if
Statement - 5.3.2 The switch Statement
- 5.3.1 The
- 5.4 Iterative Statements
- 5.4.1 The
while
Statement - 5.4.2 Traditional
for
Statement - 5.4.3 Range
for
Statement - 5.4.4 The
do while
Statement
- 5.4.1 The
- 5.5 Jump Statements
- 5.5.1 The
break
Statement - 5.5.2 The
continue
Statement - 5.5.3 The
goto
Statement
- 5.5.1 The
- 5.6
try
Blocks and Exception Handling- 5.6.1 A
throw
Expression - 5.6.2 The
try
Block - 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
return
Statement - 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
constexpr
Functions - 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
static
Class 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.