C++ for Dummies

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

The best-selling C++ For Dummies book makes C++ easier! C++ For Dummies, 7th Edition is the best-selling C++ guide on the market, fully revised for the 2014 update. With over 60% new content, this updated guide reflects the new standards, and includes a new Big Data focus that highlights the use of C++ among popular Big Data software solutions. The book provides step-by-step instruction from the ground up, helping beginners become programmers and allowing intermediate programmers to sharpen their skills. The companion website provides all code mentioned in the text, an updated GNU_C++, the new C++ compiler, and other applications. By the end of the first chapter, you will have programmed your first C++ application! As one of the most commonly used programming languages, C++ is a must-have skill for programmers who wish to remain versatile and marketable. C++ For Dummies, 7th Edition provides clear, concise, expert instruction, which is organized for easy navigation and designed for hands-on learning. Whether you're new to programming, familiar with other languages, or just getting up to speed on the new libraries, features, and generics, this guide provides the information you need. Provides you with an introduction to C++ programming Helps you become a functional programmer Features information on classes, inheritance, and optional features Teaches you 10 ways to avoid adding bugs The book incorporates the newest C++ features into the fundamental instruction, allowing beginners to learn the update as they learn the language. Staying current on the latest developments is a crucial part of being a programmer, and C++ For Dummies, 7th Edition gets you started off on the right foot.

Author(s): Stephen Randy Davis
Series: For Dummies
Edition: 7
Publisher: For Dummies
Year: 2014

Language: English
Pages: 480

Front Cover
Title Page
Copyright Page
Contents at a Glance
Table of CONTENTS
Introduction
About This Book
Icons Used in This Book
Beyond the Book
Where to Go from Here
PART I Getting Started with C++ Programming
CHAPTER 1 Writing Your First C++ Program
Grasping C++ Concepts
Installing Code::Blocks
Creating Your First C++ Program
Executing Your Program
Reviewing the Annotated Program
Calculating Expressions
CHAPTER 2 Declaring Variables Constantly
Declaring Variables
Declaring Different Types of Variables
Declaring Variable Types
Wide Loads on Char Highway
Are These Calculations Really Logical?
Mixed Mode Expressions
Automatic Declarations
CHAPTER 3 Performing Mathematical Operations
Performing Simple Binary Arithmetic
Decomposing Expressions
Determining the Order of Operations
Performing Unary Operations
Using Assignment Operators
CHAPTER 4 Performing Logical Operations
Why Mess with Logical Operations?
Using the Simple Logical Operators
Expressing Binary Numbers
Performing Bitwise Logical Operations
CHAPTER 5 Controlling Program Flow
Controlling Program Flow with the Branch Commands
Executing Loops in a Program
Nesting Control Commands
Switching to a Different Subject?
PART II Becoming a Functional C++ Programmer
CHAPTER 6 Creating Functions
Writing and Using a Function
Understanding the Details of Functions
Overloading Function Names
Defining Function Prototypes
Defaulting Arguments
Passing by Value and Passing by Reference
Variable Storage Types
CHAPTER 7 Storing Sequences in Arrays
Arraying the Arguments for Arrays
Using Arrays of Characters
Manipulating Strings with Character
Adding Some Library Functions
Making Room for Wide Strings
CHAPTER 8 Taking a First Look at C++ Pointers
Variable Size
What’s in an Address?
Address Operators
Using Pointer Variables
Passing Pointers to Functions
Constant const Irritation
Making Use of a Block of Memory Called the Heap
CHAPTER 9 Taking a Second Look at C++ Pointers
Defining Operations on Pointer Variables
When Is a Pointer Not?
Declaring and Using Arrays of Pointers
CHAPTER 10 The C++ Preprocessor
What Is a Preprocessor?
Including Files
#Defining Things
Including Things #if I Say So
Intrinsically Defined Objects
Typedef
PART III Introduction to Classes
CHAPTER 11 Examining Object-Oriented Programming
Abstracting Microwave Ovens
Classifying Microwave Ovens
Why Classify?
CHAPTER 12 Adding Class to C++
Introducing the Class
The Format of a Class
Accessing the Members of a Class
Activating Our Objects
Adding a Member Function
Calling a Member Function
Scope Resolution (And I Don’t Mean How Well Your Telescope Works)
Defining a Member Function in the Class
Keeping a Member Function after Class
Overloading Member Functions
CHAPTER 13 Point and Stare at Objects
Declaring Arrays of Objects
Declaring Pointers to Objects
Passing Objects to Functions
Why Bother with Pointers or References?
Returning to the Heap
Linking Up with Linked Lists
Ray of Hope: A List of Containers Linked to the C++ Library
CHAPTER 14 Protecting Members: Do Not Disturb
Protecting Members
Making an Argument for Using Protected Members
Giving Non-member Functions Access to Protected Members
CHAPTER 15 “Why Do You Build Me Up, Just to Tear Me Down, Baby?”
Creating Objects
Using Constructors
Dissecting a Destructor
CHAPTER 16 Making Constructive Arguments
Outfitting Constructors with Arguments
Placing Too Many Demands on the Carpenter: Overloading the Constructor
Defaulting Default Constructors
Constructing Class Members
Reconstructing the Order of Construction
Constructing Arrays
Constructors as a Form of Conversion
CHAPTER 17 The Copy/Move Constructor
Copying an Object
The Automatic Copy Constructor
Creating Shallow Copies versus Deep Copies
It’s a Long Way to Temporaries
CHAPTER 18 Static Members: Can Fabric Softener Help?
Defining a Static Member
Declaring Static Member Functions
What Is this About Anyway?
PART IV Inheritance
CHAPTER 19 Inheriting a Class
Do I Need My Inheritance?
How Does a Class Inherit?
Having a HAS_A Relationship
CHAPTER 20 Examining Virtual Member Functions: Are They for Real?
Why You Need Polymorphism
How Polymorphism Works
When Is a Virtual Function Not?
Considering Virtual Considerations
CHAPTER 21 Factoring Classes
Factoring
Implementing Abstract Classes
PART V Security
CHAPTER 22 A New Assignment Operator, Should You Decide to Accept It
Comparing Operators with Functions.
Inserting a New Operator.
Creating Shallow Copies Is a Deep Problem.
Overloading the Assignment Operator.
Overloading the Subscript Operator.
The Move Constructor and Move Operator.
CHAPTER 23 Using Stream I/O
How Stream I/O Works.
Stream Input/Output.
Other Methods of the Stream Classes.
Using the stringstream Subclasses.
Manipulating Manipulators.
CHAPTER 24 Handling Errors — Exceptions
Justifying a New Error Mechanism?.
Examining the Exception Mechanism.
What Kinds of Things Can I Throw?.
Just Passing Through.
CHAPTER 25 Inheriting Multiple Inheritance
Describing the Multiple Inheritance Mechanism.
Straightening Out Inheritance Ambiguities.
Adding Virtual Inheritance.
Constructing the Objects of Multiple Inheritance.
Voicing a Contrary Opinion.
CHAPTER 26 Tempting C++ Templates
Generalizing a Function into a Template.
Class Templates.
Tips for Using Templates.
External Template Instantiations.
Implementing an Initializer List.
CHAPTER 27 Standardizing on the Standard Template Library
The string Container.
Iterating through Lists.
CHAPTER 28 Writing Hacker-Proof Code
Understanding the Hacker’s Motives.
Understanding Code Injection.
Overflowing Buffers for Fun and Profit.
PART VI The Part of Tens
CHAPTER 29 Ten Ways to Avoid Adding Bugs to Your Program
Enable All Warnings and Error Messages
Adopt a Clear and Consistent Coding Style
Limit the Visibility
Comment Your Code While You Write It
Single-Step Every Path at Least Once
Avoid Overloading Operators
Manage the Heap Systematically
Use Exceptions to Handle Errors
Declare Destructors Virtual
Avoid Multiple Inheritance
CHAPTER 30 Ten Ways to Protect Your Programs from Hackers
Don’t Make Assumptions about User Input
Handle Failures Gracefully
Maintain a Program Log
Follow a Good Development Process
Implement Good Version Control
Authenticate Users Securely
Manage Remote Sessions
Obfuscate Your Code
Sign Your Code With a Digital Certificate
Use Secure Encryption Wherever Necessary
INDEX
Symbols and Numerics
A
B
C
D
E-F
G
H-I
J-L
M
N
O
P
R
S
T-U
V
W
X-Z
About the Author
Dedication
FAQ