Get 1 Year of unlimited Apress for $199
Instant access to all available titles and new releases Apress Access Subscription

Beginning C++

By Ivor Horton

  • eBook Price: $41.99
Buy eBook Buy Print Book
Beginning C++ is based on and supersedes Ivor Horton’s previous book, Beginning ANSI C++. This book is a tutorial for beginners in C++ and discusses a subset of C++ that is suitable for beginners. The language syntax will correspond to the proposed C++14 standard.

Full Description

  • Add to Wishlist
  • ISBN13: 978-1-484200-08-7
  • 632 Pages
  • User Level: Beginner to Advanced
  • Publication Date: November 12, 2014
  • Available eBook Formats: EPUB, MOBI, PDF

Related Titles

  • C++ Standard Library Quick Reference
  • MATLAB Recipes
  • C++ 14 Quick Syntax Reference, Second Edition
  • Beginning Backdrop CMS
  • CSS Mastery
  • JavaScript Recipes
  • JSON Quick Syntax Reference
  • Building Embedded Systems
  • PHP and MySQL Recipes
  • Creating Google Chrome Extensions
Full Description

Beginning C++ is a tutorial for beginners in C++ and discusses a subset of C++ that is suitable for beginners. The language syntax corresponds to the C++14 standard. This book is environment neutral and does not presume any specific operating system or program development system. There is no assumption of prior programming knowledge.

All language concepts that are explained in the book are illustrated with working program examples. Most chapters include exercises for you to test your knowledge. Code downloads are provided for examples from the text and solutions to the exercises and there is an additional download for a more substantial project for you to try when you have finished the book.

This book introduces the elements of the C++ standard library that provide essential support for the language syntax that is discussed. While the Standard Template Library (STL) is not discussed to a significant extent, a few elements from the STL that are important to the notion of modern C++ are introduced and applied.

Beginning C++ is based on and supersedes Ivor Horton’s previous book, Beginning ANSI C++.

What you’ll learn

  • How to work with fundamental C++ data types and do calculations
  • How to build logic into a program using loops, choices, decisions and more
  • How to work with arrays, vectors, and strings
  • How to use raw pointers and smart pointers
  • How to program with functions and deal with program files and pre-processing directives
  • How to define your own data types using classes and class operations
  • How to implement operator overloading for your own data types
  • How to apply class inheritance and use virtual functions to obtain polymorphism and errors/exception handling
  • How to signal and handle errors using exceptions
  • How to define and use function templates and class templates
  • How to do file input and output with C++

Who this book is for

This book is for industry practitioners and students wanting to learn C++ and use this as a reference guide for their applications.

Table of Contents

Table of Contents

Chapter 1: Basic Ideas

Chapter 2: Introducing Fundamental Types of Data

Chapter 3: Working Fundamental Types

Chapter 4: Making Decisions

Chapter 5: Arrays and Loops

Chapter 6: Pointers and References

Chapter 7: Working with Strings

Chapter 8: Defining Functions

Chapter 9: Lambda Expressions

Chapter 10: Preprocessor directives

Chapter 11: Defining your own Data Types

Chapter 12: Operator Overloading

Chapter 13: Inheritance

Chapter 14: Virtual Functions and Polymorphism

Chapter 15: Runtime Errors and Exceptions

Chapter 16: Class Templates

Chapter 17: File Input and Output

Source Code/Downloads

Downloads are available to accompany this book.

Your operating system can likely extract zipped downloads automatically, but you may require software such as WinZip for PC, or StuffIt on a Mac.


If you think that you've found an error in this book, please let us know by emailing to . You will find any confirmed erratum below, so you can check if your concern has already been addressed.

On page 12:

Superscript formatting was inadvertently dropped in the following text:

F5B9E1 as a decimal value is given by

15 X 165 + 5 X 164 + 11 x 163 +9 x 162 + 14 x 161 + 1 x 160
Author Comment:

It should read:

F5B9E1 as a decimal value is given by

15 X 16 (to the 5th power) + 5 X 16 to the 4th power) + 11 x 16 (to the 3rd power) +9 x 16 (squared) + 14 x 16 (to the first power) + 1 x 16 (to the zero power)

On page 205:

On page 205, in the last of the insert examples, the book says

phrase.insert(16, 7, ‘*’);

The text then goes on to say:

“This inserts five asterisks in phrase immediately before character at index 13. phrase will then contain the uninformative sentence “We can insert a *******string.”

Both the insert code and the result show 7 asterisks where inserted at index position 16, not 5 asterisks at position 13.
Author Comment:

The sentence following the code should begin:

"This inserts seven asterisks in phrase..."


    1. Modern X86 Assembly Language Programming


      View Book

    2. Practical OpenCV


      View Book

    3. C Quick Syntax Reference


      View Book

    4. C++ 2013 for C# Developers


      View Book