C++ For Dummies

Front Cover
John Wiley & Sons, Apr 20, 2009 - Computers - 432 pages
Enter the world of computer programming with this step-by-step guide to the C++ language! C++ is a great introduction to object-oriented programming, and this friendly guide covers everything you need to know and nothing you don’t. You’ll write your first program by the end of Chapter 1.

C++ For Dummies, 6th Edition, helps you understand C++ programming from the ground up. It’s full of examples to show you how things work, and it even explains “why”, so you understand how the pieces fit together. And the bonus CD includes a special code editor, an update GNU compiler, and all source code from the book to save you time.

  • Learn programming lingo and what terms like object-oriented, compiler, and executable mean, so you can write a program right away
  • See how to bundle sections of your code into modules that can be reused in different programs
  • Work with features of object-oriented programming such as classes, constructors, and destructors
  • Discover how the concept of inheritance is the key to effective C++ programming
  • Work with assignment operators, stream I/O, and other more advanced concepts, once you’ve grasped the basics

You’ll discover ten ways to avoid adding bugs to your programs, what pointers are and how to use them, how to work with strings, and some advanced features new to C++. C++ For Dummies, 6th Edition gets you up and running with this popular object-oriented language.

Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.

 

Contents

Introduction
1
Optional Features
5
Writing Your First C++ Program
13
Declaring Variables Constantly
25
Types of constants
32
Performing Mathematical Operations
41
Performing Logical Operations
49
Expressing Binary Numbers
55
Making Constructive Arguments
217
Members construct in the order in which they are declared
233
Copying the Copy Copy Copy Constructor
235
Defining a Static Member
247
Inheriting a Class
257
Factoring Classes
273
A New Assignment Operator
283
Other Methods of the Stream Classes
301

Do something logical with logical calculations
62
Controlling Program Flow
63
Switching to a Different Subject?
77
Becoming a Functional C++ Programmer
79
7
95
Accessing too far into an array
101
9
102
Adding Some Library Functions
107
Creating Functions Chapter 7 Storing Sequences in Arrays Chapter 8 Taking a First Look at C++ Pointers 111 81 95
111
Taking a Second Look at C++ Pointers
127
14
143
The C++ Preprocessor
145
Typedef
158
Introduction to Classes
159
Introducing the Class
165
Point and Stare at Objects
181
Protecting Members Do Not Disturb
197
15
205
Using the stringstream Subclasses
308
A New Assignment Operator Should You Decide to Accept It 283 Chapter 23 Using Stream
315
Just Passing Through
324
Inheriting Multiple Inheritance
325
Tempting C++ Templates
337
Standardizing on the Standard Template Library
345
The Part of Tens
355
Ten Ways to Avoid Adding Bugs to Your Program
359
Avoid Overloading Operators Manage the Heap Systematically Use Exceptions to Handle Errors
363
Ten Major Recent Additions to
371
About the CD
377
Index
383
63
385
Cheating
386
247
388
325
395
Generating output Calculating Expressions Storing the results of an expression 23
397
Copyright

Other editions - View all

Common terms and phrases

About the author (2009)

Stephen R. Davis is the bestselling author of several books on C++, including previous editions of C++ For Dummies. He has been programming for more than 30 years and presently works for L-3 Communications in the area of Homeland Defense.

Bibliographic information