Book 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 Hortons previous book, Beginning ANSI C++.
Table of contents
- Cover
- Title
- Copyright
- Dedication
- Contents at a Glance
- Contents
- About the Author
- About the Technical Reviewer
- Introduction
- Chapter 1: Basic Ideas
-
Chapter 2: Introducing Fundamental Types of Data
- Variables, Data, and Data Types
- Integer Literals
- Calculations with Integers
- The op= Assignment Operators
- using Declarations and Directives
- The sizeof Operator
- Incrementing and Decrementing Integers
- Defining Floating-Point Variables
- Floating-Point Literals
- Floating-Point Calculations
- Formatting Stream Output
- Mixed Expressions and Type Conversion
- Explicit Type Conversion
- Finding the Limits
- Working with Character Variables
- The auto Keyword
- Lvalues and Rvalues
- Summary
- Chapter 3: Working with Fundamental Data Types
- Chapter 4: Making Decisions
-
Chapter 5: Arrays and Loops
- Arrays
- Understanding Loops
- The for Loop
- Avoiding Magic Numbers
- Defining the Array Size with the Initializer List
- Determining the Size of an Array
- Controlling a for Loop with Floating-Point Values
- More Complex for Loop Control Expressions
- The Comma Operator
- The Ranged-based for Loop
- The while Loop
- Allocating an Array at Runtime
- The do-while Loop
- Nested Loops
- Skipping Loop Iterations
- Breaking Out of a Loop
- Arrays of Characters
- Multidimensional Arrays
- Alternatives to Using an Array
- Summary
- Chapter 6: Pointers and References
- Chapter 7: Working with Strings
- Chapter 8: Defining Functions
- Chapter 9: Lambda Expressions
- Chapter 10: Program Files and Preprocessing Directives
-
Chapter 11: Defining Your Own Data Types
- Classes and Object-Oriented Programming
- Terminology
- Defining a Class
- Constructors
- Accessing Private Class Members
- Friends
- The this Pointer
- const Objects and const Member Functions
- Arrays of Class Objects
- The Size of a Class Object
- Static Members of a Class
- Destructors
- Pointers and References to Class Objects
- Using Pointers As Class Members
- Nested Classes
- Summary
- Chapter 12: Operator Overloading
-
Chapter 13: Inheritance
- Classes and Object-Oriented Programming
- Inheritance in Classes
- protected Members of a Class
- The Access Level of Inherited Class Members
- Constructor Operation in a Derived Class
- Destructors Under Inheritance
- Duplicate Data Member Names
- Duplicate Function Member Names
- Multiple Inheritance
- Converting Between Related Class Types
- Summary
-
Chapter 14: Polymorphism
-
Understanding Polymorphism
- Using a Base Class Pointer
- Calling Inherited Functions
- Virtual Functions
- Default Argument Values in Virtual Functions
- Virtual Function Calls with Smart Pointers
- Using References to Call Virtual Functions
- Calling the Base Class Version of a Virtual Function
- Converting Between Pointers to Class Objects
- Dynamic Casts
- Converting References
- Determining the Polymorphic Type
- The Cost of Polymorphism
- Pure Virtual Functions
- Destroying Objects Through a Pointer
- Summary
-
Understanding Polymorphism
- Chapter 15: Runtime Errors and Exceptions
-
Chapter 16: Class Templates
- Understanding Class Templates
- Defining Class Templates
- Instantiating a Class Template
- Static Members of a Class Template
- Non-Type Class Template Parameters
- Default Values for Template Parameters
- Explicit Template Instantiation
- Special Cases
- Friends of Class Templates
- Class Templates with Nested Classes
- Summary
- Chapter 17: File Input and Output
- Index
Product information
- Title: Beginning C++
- Author(s):
- Release date: November 2014
- Publisher(s): Apress
- ISBN: 9781484200070
You might also like
book
Sams Teach Yourself Java in 21 Days (Covers Java 11/12), 8th Edition
In just 21 days, you can acquire the knowledge and skills necessary to develop applications on …
book
Beginning C, Fifth Edition
Beginning C, 5th Edition teaches you how to program using the widely-available C language. You'll begin …
book
Beginning C: From Beginner to Pro
Learn how to program using C, beginning from first principles and progressing through step-by-step examples to …
book
Modern C++ for Absolute Beginners: A Friendly Introduction to C++ Programming Language and C++11 to C++20 Standards
Learn the C++ programming language in a structured, straightforward, and friendly manner. This book teaches the …