rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9780764568527

C++ For Dummies®, 5th Edition

by
  • ISBN13:

    9780764568527

  • ISBN10:

    0764568523

  • Edition: 5th
  • Format: Paperback
  • Copyright: 2004-05-01
  • Publisher: For Dummies
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $24.99

Summary

If you've thought of programmers as elite intelligentsia who possess expertise (and perhaps genes) the rest of us will never have, think again. C++ For Dummies, 5 th Edition, debunks the myths, blasts the barriers, shares the secrets, and gets you started. In fact, by the end of Chapter 1, you'll be able to create a C++ program. OK, it won't be newest, flashiest video game, but it might be a practical, customized inventory control or record-keeping program.Most people catch on faster when they actually DO something, so C++ For Dummies includes a CD-ROM that gives you all you need to start programming (except the guidance in the book, of course), including: Dev-C, a full-featured, integrated C++ compiler and editor you install to get down to business The source code for the programs in the book, including code for BUDGET, programs that demonstrate principles in the book Documentation for the Standard Template Library Online C++ help files Written by Stephen Randy Davis, author of C++ Weekend Crash Course, C++ for Dummies, takes you through the programming process step-by-step. You'll discover how to: Generate an executable Create source code, commenting it as you go and using consistent code indentation and naming conventions Write declarations and name variables, and calculate expressions Write and use a function, store sequences in arrays, and declare and use pointer variables Understand classes and object-oriented programming Work with constructors and destructors Use inheritance to extend classes Use stream I/O Comment your code as you go, and use consistent code indentation and naming conventions Automate programming with the Standard Template Library (STL) C++ for Dummies 5 th Edition is updated for the newest ANSI standard to make sure you're up to code.Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.

Author Biography

Stephen Randy Davis is the best-selling author of numerous books and articles including "C++ for Dummies", "C++ Weekend Crash Course", "C# for Dummies" and "C# Weekend Crash Course".  Mr. Davis has been programming for over 30 years. He currently works for L-3 Communications in the area of Homeland Defense.

Table of Contents

Introduction 1(6)
What's in This Book
1(1)
What's on the CD
2(1)
What Is C++?
2(1)
Conventions Used in This Book
2(1)
How This Book Is Organized
3(1)
And There's More
4(1)
Part I: Introduction to C++ Programming
4(1)
Part II: Becoming a Functional C++ Programmer
4(1)
Part III: Introduction to Classes
5(1)
Part IV: Inheritance
5(1)
Part V: Optional Features
5(1)
Part VI: The Part of Tens
5(1)
Icons Used in This Book
6(1)
Where to Go from Here
6(1)
Part I: Introduction to C++ Programmning 7(70)
Chapter 1: Writing Your First C++ Program
9(18)
Grasping C++ Concepts
10(2)
What's a program?
10(1)
How do I program?
11(1)
Installing Dev-C++
12(4)
Setting the options
15(1)
Creating Your First C++ Program
16(4)
Entering the C++ code
17(1)
Building your program
18(2)
Executing Your Program
20(1)
Dev-C++ is not Windows
21(1)
Dev-C++ help
21(1)
Reviewing the Annotated Program
21(4)
Examining the framework for all C++ programs
22(1)
Clarifying source code with comments
22(1)
Basing programs on C++ statements
23(1)
Writing declarations
24(1)
Generating output
25(1)
Calculating Expressions
25(2)
Storing the results of expression
26(1)
Examining the remainder of Conversion.cpp
26(1)
Chapter 2: Declaring Variables Constantly
27(12)
Declaring Variables
27(1)
Declaring Different Types of Variables
28(5)
Reviewing the limitations of integers in C++
29(1)
Solving the truncation problem
30(1)
Looking at the limits of floating-point numbers
31(2)
Declaring Variable Types
33(3)
Types of constants
34(1)
Special characters
35(1)
Are These Calculations Really Logical?
36(1)
Mixed Mode Expressions
36(3)
Chapter 3: Performing Mathematical Operations
39(8)
Performing Simple Binary Arithmetic
40(1)
Decomposing Expressions
41(1)
Determining the Order of Operations
42(1)
Performing Unary Operations
43(2)
Using Assignment Operators
45(2)
Chapter 4: Performing Logical Operations
47(14)
Why Mess with Logical Operations?
47(1)
Using the Simple Logical Operators
48(5)
Storing logical values
49(2)
Using logical int variables
51(1)
Be careful performing logical operations on floating-point variables
51(2)
Expressing Binary Numbers
53(3)
The decimal number system
54(1)
Other number systems
54(1)
The binary number system
54(2)
Performing Bitwise Logical Operations
56(5)
The single bit operators
57(1)
Using the bitwise operators
58(1)
A simple test
59(1)
Do something logical with logical calculations
60(1)
Chapter 5: Controlling Program Flow
61(16)
Controlling Program Flow with the Branch Commands
61(2)
Executing Loops in a Program
63(10)
Looping while a condition is true
64(1)
Using the autoincrement/autodecrement feature
65(2)
Using the for loop
67(2)
Avoiding the dreaded infinite loop
69(1)
Applying special loop controls
70(3)
Nesting Control Commands
73(1)
Switching to a Different Subject?
74(3)
Part II: Becoming a Functional C++ Programmer 77(78)
Chapter 6: Creating Functions
79(14)
Writing and Using a Function
79(4)
Defining the sumSequence() function
81(1)
Calling the function sumSequence()
82(1)
Divide and conquer
82(1)
Understanding the Details of Functions
83(4)
Understanding simple functions
84(1)
Understanding functions with arguments
85(2)
Overloading Function Names
87(2)
Defining Function Prototypes
89(2)
Variable Storage Types
91(1)
Including Include Files
91(2)
Chapter 7: Storing Sequences in Arrays
93(16)
Considering the Need for Arrays
93(7)
Using an array
95(3)
Initializing an array
98(1)
Accessing too far into an array
99(1)
Using arrays
99(1)
Defining and using arrays of arrays
100(1)
Using Arrays of Characters
100(3)
Creating an array of characters
100(1)
Creating a string of characters
101(2)
Manipulating Strings with Character
103(3)
String-ing Along Variables
106(3)
Chapter 8: Taking a First Look at C++ Pointers
109(16)
Variable Size
109(1)
What's in an Address?
110(1)
Address Operators
111(1)
Using Pointer Variables
112(5)
Comparing pointers and houses
114(1)
Using different types of pointers
114(3)
Passing Pointers to Functions
117(2)
Passing by value
117(1)
Passing pointer values
118(1)
Passing by reference
119(1)
Making Use of a Block of Memory Called the Heap
119(6)
Limiting scope
120(1)
Examining the scope problem
121(1)
Providing a solution using the heap
122(3)
Chapter 9: Taking a Second Look at C++ Pointers
125(14)
Defining Operations on Pointer Variables
125(8)
Re-examining arrays in light of pointer variables
126(2)
Applying operators to the address of an array
128(1)
Expanding pointer operations to a string
129(2)
Justifying pointer-based string manipulation
131(1)
Applying operators to pointer types other than char
131(1)
Contrasting a pointer with an array
132(1)
Declaring and Using Arrays of Pointers
133(6)
Utilizing arrays of character strings
134(2)
Accessing the arguments to main()
136(3)
Chapter 10: Debugging C++
139(16)
Identifying Types of Errors
139(1)
Choosing the WRITE Technique for the Problem
140(6)
Catching bug #1
142(1)
Catching bug #2
143(3)
Calling for the Debugger
146(11)
Defining the debugger
147(1)
Finding commonalities among us
147(1)
Running a test program
148(1)
Single-stepping through a program
149(6)
Part III: Introduction to Classes 155(104)
Chapter 11: Examining Object-Oriented Programming
157(4)
Abstracting Microwave Ovens
157(2)
Preparing functional nachos
158(1)
Preparing object-oriented nachos
159(1)
Classifying Microwave Ovens
159(1)
Why Classify?
160(1)
Chapter 12: Adding Class to C++
161(6)
Introducing the Class
161(1)
The Format of a Class
162(1)
Accessing the Members of a Class
163(4)
Chapter 13: Making Classes Work
167(16)
Activating Our Objects
168(1)
Simulating real-world objects
168(1)
Why bother with member functions?
169(1)
Adding a Member Function
169(2)
Creating a member function
170(1)
Naming class members
171(1)
Calling a Member Function
171(4)
Accessing a member function
172(2)
Accessing other members from a member function
174(1)
Scope Resolution (And I Don't Mean How Well Your Microscope Works)
175(2)
Defining a Member Function in the Class
177(2)
Keeping a Member Function After Class
179(2)
Overloading Member Functions
181(2)
Chapter 14: Point and Stare at Objects
183(18)
Defining Arrays of and Pointers to Simple Things
183(1)
Declaring Arrays of Objects
184(1)
Declaring Pointers to Objects
185(2)
Dereferencing an object pointer
186(1)
Pointing toward arrow pointers
187(1)
Passing Objects to Functions
187(5)
Calling a function with an object value
188(1)
Calling a function with an object pointer
189(2)
Calling a function by using the reference operator
191(1)
Why Bother with Either Pointers or References?
192(1)
Returning to the Heap
192(1)
Comparing Pointers to References
193(1)
Why Not Use References Rather Than Pointers?
193(2)
Linking Up with Linked Lists
195(5)
Performing other operations on a linked list
196(1)
Hooking up with a LinkedListData program
197(3)
A Ray of Hope: A List of Containers Linked to the C++ Library
200(1)
Chapter 15: Protecting Members: Do Not Disturb
201(8)
Protecting Members
201(3)
Why you need protected members
201(1)
Discovering how protected members work
202(2)
Making an Argument for Using Protected Members
204(1)
Protecting the internal state of the class
204(1)
Using a class with a limited interface
205(1)
Giving Non-Member Functions Access to Protected Members
205(4)
Chapter 16: "Why Do You Build Me Up, Just to Tear Me Down, Baby?"
209(12)
Creating Objects
209(1)
Using Constructors
210(7)
Why you need constructors
210(2)
Making constructors work
212(5)
Dissecting a Destructor
217(4)
Why you need the destructor
217(1)
Working with destructors
217(4)
Chapter 17: Making Constructive Arguments
221(18)
Outfitting Constructors with Arguments
221(2)
Justifying constructors
222(1)
Using a constructor
222(1)
Placing Too Many Demands on the Carpenter: Overloading the Constructor
223(4)
Defaulting Default Constructors
227(1)
Constructing Class Members
228(5)
Constructing a complex data member
228(4)
Constructing a constant data member
232(1)
Constructing the Order of Construction
233(6)
Local objects construct in order
234(1)
Static objects construct only once
234(1)
All global objects construct before main()
235(1)
Global objects construct in no particular order
235(1)
Members construct in the order in which they are declared
236(1)
Destructors destruct in the reverse order of the constructors
237(2)
Chapter 18: Copying the Copy Copy Copy Constructor
239(12)
Copying an Object
239(3)
Why you need the copy constructor
239(1)
Using the copy constructor
240(2)
The Automatic Copy Constructor
242(2)
Creating Shallow Copies versus Deep Copies
244(4)
It's a Long Way to Temporaries
248(3)
Avoiding temporaries, permanently
249(1)
Referring to the copy constructor's referential argument
250(1)
Chapter 19: Static Members: Can Fabric Softener Help?
251(8)
Defining a Static Member
251(4)
Why you need static members
251(1)
Using static members
252(1)
Referencing static data members
253(2)
Uses for static data members
255(1)
Declaring Static Member Functions
255(3)
What Is This About, Anyway?
258(1)
Part IV: Inheritance 259(44)
Chapter 20: Inheriting a Class
261(8)
Do I Need My Inheritance?
262(1)
How Does a Class Inherit?
263(4)
Using a subclass
265(1)
Constructing a subclass
265(2)
Destructing a subclass
267(1)
Having a HAS_A Relationship
267(2)
Chapter 21: Examining Virtual Member Functions: Are They for Real?
269(10)
Why You Need Polymorphism
272(2)
How Polymorphism Works
274(2)
When Is a Virtual Function Not?
276(1)
Considering Virtual Considerations
277(2)
Chapter 22: Factoring Classes
279(24)
Factoring
279(5)
Implementing Abstract Classes
284(7)
Describing the abstract class concept
286(1)
Making an honest class out of an abstract class
287(2)
Passing abstract classes
289(1)
Declaring pure virtual functions - is it really necessary?
290(1)
Factoring C++ Source Code
291(14)
Dividing the program - Student
292(1)
Defining a namespace
293(1)
Implementing Student
294(1)
Dividing the program - GraduateStudent
295(1)
Implementing an application
296(2)
Project file
298(1)
Creating a project file under Dev-C++
298(5)
Part V: Optional Features 303(72)
Chapter 23: A New Assignment Operator, Should You Decide to Accept It
305(8)
Comparing Operators with Functions
305(1)
Inserting a New Operator
306(1)
Creating Shallow Copies Is a Deep Problem
307(1)
Overloading the Assignment Operator
308(3)
Protecting the Escape Hatch
311(2)
Chapter 24: Using Stream I/O
313(16)
How Stream I/O Works
313(2)
The fstream Subclasses
315(5)
Reading Directly from a Stream
320(2)
What's Up with end!?
322(1)
Using the strstream Subclasses
322(3)
Manipulating Manipulators
325(4)
Chapter 25: Handling Errors - Exceptions
329(10)
Justifying a New Error Mechanism?
331(1)
Examining the Exception Mechanism
332(3)
What Kinds of Things Can I Throw?
335(4)
Chapter 26: Inheriting Multiple Inheritance
339(12)
Describing the Multiple Inheritance Mechanism
339(2)
Straightening Out Inheritance Ambiguities
341(1)
Adding Virtual Inheritance
342(7)
Constructing the Objects of Multiple Inheritance
349(1)
Voicing a Contrary Opinion
349(2)
Chapter 27: Tempting C++ Templates
351(12)
Generalizing a Function into a Template
353(2)
Template Classes
355(3)
Do I Really Need Template Classes?
358(3)
Tips for Using Templates
361(2)
Chapter 28: Standardizing on the Standard Template Library
363(12)
The string Container
364(2)
The list Containers
366(2)
Iterators
368(3)
Using Maps
371(4)
Fart VI: The Part of Tens 375(18)
Chapter 29: Ten Ways to Avoid Adding Bugs to Your Program
377(8)
Enabling All Warnings and Error Messages
377(1)
Insisting on Clean Compiles
378(1)
Adopting a Clear and Consistent Coding Style
379(1)
Limiting the Visibility
379(2)
Commenting Your Code While You Write It
381(1)
Single-Stepping Every Path at Least Once
381(1)
Avoid Overloading Operators
382(1)
Heap Handling
382(1)
Using Exceptions to Handle Errors
382(1)
Avoiding Multiple Inheritance
383(2)
Chapter 30: The Ten Most Important Optional Features of Dev-C++
385(8)
Customize Editor Settings to Your Taste
385(1)
Highlight Matching Braces/Parentheses
386(1)
Enable Exception Handling
387(1)
Include Debugging Information (Sometimes)
387(1)
Create a Project File
388(1)
Customize the Help Menu
388(1)
Reset Breakpoints after Editing the File
388(1)
Avoid Illegal Filenames
389(1)
Include #include Files in Your Project
389(1)
Executing the Profiler
389(4)
Appendix: About the CA 393(14)
System Requirements
393(1)
Using the CD with Microsoft Windows
394(1)
Using the CD with Linux
395(1)
What You'll Find
396(1)
Development tools
396(1)
Program source code
397(1)
If You've Got Problems (Of the CD Kind)
397(10)
Bonus Chapters on the CA-ROM! CD
Bonus Chapter 1: A Functional Budget Program
BC1
BUDGET 1
BC1
BUDGET 2
BC7
BUDGET 3
BC16
Implementing a linked list module
BC17
Taking savings and checking into account
BC19
The linked list classes
BC26
Assessing the budget
BC28
BUDGET 4
BC28
Implementing linked list as a template class
BC29
It's easy to con-template
BC31
Balancing the template budget BC37
BUDGET 5
BC37
Listing containers
BC38
Making a list of the accounts
BC43
Bonus Chapter 2: Using Visual C++.NET
BC45
Building a Project
BC45
Adding an Existing Program to an Existing Project
BC47
Creating a New Program Project
BC49
Index 407

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program