rent-now

Rent More, Save More! Use code: ECRENTAL

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

9780764527920

C++ For Dummies?, 4th Edition

by
  • ISBN13:

    9780764527920

  • ISBN10:

    0764527924

  • Format: eBook
  • Copyright: 2001-03-01
  • Publisher: For Dummies
  • View Upgraded Edition
  • 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
We're Sorry.
No Options Available at This Time.

Summary

Unlike other C++ programming books, C++ For Dummies considers the "why" just as important as the "how." The features of C++ are like pieces of a jigsaw puzzle. Rather than just present the features, this book will help you to really understand how they fit together. After you finish this book, you'll be able to write a reasonable C++ program, and, just as important, you'll understand why and how it works.C++, as the name implies, is the next generation of the C programming language. The experienced C programmer will find C++ both exciting and frustrating. This book will help you get from C to C++ as painlessly as possible; however, C++ For Dummies, 4th Edition, doesn't assume that the reader knows anything about C language. Anyone, from any programming background, will quickly discover how to Write your first program Create source code Use the Visual C++ help system Build objects Develop C++ pointers Debug your programs This fourth edition of C++ For Dummies begins with basic programming concepts. The book works its way through simple syntax into the care and feeding of basic programs right into object-oriented concepts. Once you've digested the entire content of the book, you should have no trouble impressing your friends and acquaintances at parties. You'll find coverage of all these topics, and more: Declaring variables Performing logical operations Executing loops in a program Writing and using functions Passing pointers to functions Passing objects to functions Using constructors and destructors Declaring static member functions Implementing abstract classes Overloading the assignment operator C++ For Dummies does not cover Windows programming. Finding out how to program Windows in C++ is really a two-step process. First, you need to master C++. That accomplished, you can move on to Windows programming.

Table of Contents

Introductionp. 1
What's in This Bookp. 1
What's on the CDp. 2
What Is C++?p. 2
Conventions Used in This Bookp. 3
What You're Not to Readp. 3
Foolish Assumptionsp. 4
How This Book Is Organizedp. 4
Icons Used in This Bookp. 7
Where to Go from Herep. 7
Introducing C++ Programmingp. 9
Writing Your First C++ Programp. 11
Grasping C++ Conceptsp. 12
What's a program?p. 12
How do I program?p. 13
Installing GNU C++p. 14
Creating Your First C++ Programp. 14
Entering the C++ codep. 14
Building your programp. 16
Executing Your Programp. 18
GNU is guh-not Windowsp. 19
GNU C++ helpp. 19
Reviewing the Annotated Programp. 19
Examining the framework for all C++ programsp. 20
Clarifying source code with commentsp. 20
Basing programs on C++ statementsp. 21
Writing declarationsp. 21
Generating outputp. 22
Calculating Expressionsp. 22
Storing the results of expressionp. 23
Examining the remainder of Conversionp. 23
Declaring Variables Constantlyp. 25
Declaring Variablesp. 26
Declaring Different Types of Variablesp. 26
Reviewing the limitations of integers in C++p. 27
Solving the truncation problemp. 28
Examining the limitations of floating pointp. 29
Declaring Variable Typesp. 30
Types of constantsp. 31
Special charactersp. 32
Mixed Mode Expressionsp. 33
Performing Mathematical Operationsp. 35
Performing Simple Binary Arithmeticp. 36
Decomposing Expressionsp. 37
Determining the Order of Operationsp. 38
Performing Unary Operationsp. 39
Using Assignment Operatorsp. 40
Performing Logical Operationsp. 43
Why Mess with Logical Operations?p. 43
Using the Simple Logical Operatorsp. 44
Be careful performing logical operations on floating point variablesp. 45
Expressing Binary Numbersp. 47
The decimal number systemp. 48
Other number systemsp. 48
The binary number systemp. 48
Performing Bitwise Logical Operationsp. 50
The single bit operatorsp. 51
Using the bitwise operatorsp. 51
A simple testp. 52
Why define such a crazy operator?p. 54
Controlling Program Flowp. 57
Controlling Program Flow with the Branch Commandsp. 57
Executing Loops in a Programp. 59
Looping while a condition is truep. 59
Using the autoincrement/autodecrement featurep. 61
Using the for loopp. 62
Avoiding the dreaded infinite loopp. 65
Applying special loop controlsp. 65
Nesting Control Commandsp. 67
Switching to A Different Subject?p. 69
Becoming a Functional Programmerp. 71
Creating Functionsp. 73
Writing and Using a Functionp. 74
Understanding the Details of Functionsp. 76
Understanding Simple functionsp. 77
Understanding functions with argumentsp. 77
Overloading Function Namesp. 80
Defining Function Prototypesp. 82
Variable Storage Typesp. 84
Storing Sequences in Arraysp. 85
Considering the Need for Arraysp. 85
Using an arrayp. 87
Initializing an arrayp. 89
Accessing too far into an arrayp. 90
Using arrays?p. 91
Defining and using arrays of arraysp. 91
Using Arrays of Charactersp. 92
Manipulating Stringsp. 94
Writing our own concatenate functionp. 94
Reviewing the C++ string handling functionsp. 96
Handling wide charactersp. 97
Avoiding Obsolescent Output Functionsp. 98
Taking a First Look at C++ Pointersp. 99
What's in an Address?p. 99
Using Pointer Variablesp. 101
Comparing pointers and housesp. 102
Using different types of pointersp. 103
Passing Pointers to Functionsp. 105
Passing by valuep. 105
Passing pointer valuesp. 106
Passing by referencep. 107
Making Use of a Block of Memory Called the Heapp. 107
Limiting scopep. 108
Examining the scope problemp. 109
Providing a solution using the heapp. 110
Taking a Second Look at C++ Pointersp. 111
Defining Operations on Pointer Variablesp. 111
Re-examining arrays in light of pointer variablesp. 112
Applying operators to the address of an arrayp. 114
Expanding pointer operations to a stringp. 115
Applying operators to pointer types other than charp. 119
Contrasting a pointer with an arrayp. 119
Declaring and Using Arrays of Pointersp. 121
Utilizing arrays of character stringsp. 122
Accessing the arguments to main()p. 123
Remaining Functional Featuresp. 125
Breaking Programs Apart?p. 125
Looking at a Large Programp. 126
Examining the Divided FunctionDemo Programp. 127
Separating off the sumSequence() modulep. 128
Generating the remnant MainFunction.cpp modulep. 130
Creating the project filep. 131
Creating a project file under GNU C++p. 131
Creating a project file under Visual C++p. 132
Including the #include Directivep. 133
Using the Standard C++ Libraryp. 134
Debugging C++p. 135
Identifying Types of Errorsp. 135
Choosing the WRITE Technique for the Problemp. 136
Catching bugp. 137
Catching bug #2p. 140
Calling for the Debuggerp. 143
Defining the debuggerp. 144
Deciding which debugger to usep. 144
Running a test programp. 145
Single-stepping through a programp. 147
Single-stepping into a functionp. 148
Using breakpointsp. 149
Viewing and modifying variablesp. 150
Budget 1 Programp. 153
Programming with Classp. 159
Examining Object-Oriented Programmingp. 161
Abstracting Microwave Ovensp. 161
Preparing functional nachosp. 162
Preparing object-oriented nachosp. 163
Classifying Microwave Ovensp. 163
Why Classify?p. 164
Adding Class to C++p. 165
Introducing the Classp. 165
The format of a Classp. 166
Accessing the members of a Classp. 167
Example programp. 168
Making Classes Workp. 173
Activating Our Objectsp. 174
Simulating real world objectsp. 174
Why bother with member functions?p. 175
Adding a Member Functionp. 175
Creating a member functionp. 176
Naming class membersp. 177
Calling a Member Functionp. 177
Accessing a member functionp. 178
Accessing other members from a member functionp. 179
Scope Resolution (And I Don't Mean How Well Your Microscope Works)p. 180
Defining a Member Function in the Classp. 182
Keeping a Member Function After Classp. 184
Overloading Member Functionsp. 185
Creating Pointers to Objectsp. 187
Defining Arrays of and Pointers to Simple Thingsp. 187
Declaring Arrays of Objectsp. 188
Declaring Pointers to Objectsp. 189
Dereferencing an object pointerp. 190
Shooting arrow pointersp. 191
Passing Objects to Functionsp. 191
Calling a function with an object valuep. 191
Calling a function with an object pointerp. 192
Why pass pointers to functions when you can pass the object itself?p. 193
Calling a function by using the reference operatorp. 196
Returning to the Heapp. 196
Linking up with Linked Listsp. 197
The array data structurep. 197
The linked listp. 198
Performing other operations on a linked listp. 199
Properties of linked listsp. 201
Hooking Up with a LinkedListData Programp. 201
Protecting Members: Do Not Disturbp. 205
Protecting Membersp. 205
Why you need protected membersp. 205
Discovering how protected members workp. 206
Making an Argument for Using Protected Membersp. 208
Protecting the internal state of the classp. 208
Using a class with a limited interfacep. 209
Giving Non-Member Functions Access to Protected Membersp. 209
Why do I need friends? (I am a rock, I am an island)p. 209
Building and Tearing Down Objects: The Constructor and Destructorp. 213
Creating Objectsp. 213
Using Constructorsp. 214
Explaining the need for constructorsp. 214
Making constructors workp. 216
Understanding the Destructorp. 220
Why you need the destructorp. 220
Working with destructorsp. 220
Making Constructive Argumentsp. 223
Outfitting Constructors with Argumentsp. 223
Justifying constructorsp. 224
Using a constructor?p. 224
Overloading the Constructor (Is That Like Placing Too Many Demands on the Carpenter?)p. 227
Defaulting Default Constructorsp. 229
Constructing Class Membersp. 231
Constructing the Order of Constructionp. 236
Local objects construct in orderp. 236
Static objects construct only oncep. 236
All global objects construct before main()p. 237
Global objects construct in no particular orderp. 238
Members construct in the order in which they are declaredp. 239
Destructors destruct in the reverse order of the constructorsp. 240
Copying the Copy Copy Copy Constructorp. 241
Copying an Objectp. 241
Why do I need it?p. 241
Using the copy constructorp. 242
The Automatic Copy Constructorp. 244
Creating Shallow Copies versus Deep Copiesp. 246
It's a Long Way to Temporariesp. 249
Static Members: Can Fabric Softener Help?p. 253
Defining a Static Memberp. 253
Why do I need them?p. 253
Using static membersp. 254
Referencing static data membersp. 255
Uses for static data membersp. 257
Declaring Static Member Functionsp. 257
A Budget with Class--Budget2.CPPp. 261
Class Inheritancep. 271
Inheriting a Classp. 273
Do I Need Inheritance?p. 274
How Does a Class Inherit?p. 276
Constructing a Subclassp. 278
Having a HAS_A Relationshipp. 279
Examining Virtual Member Functions: Are They for Real?p. 281
Why Do I Need Polymorphism?p. 284
How Does Polymorphism Work?p. 286
Making Nachos the Polymorphic Wayp. 288
When Is a Virtual Function Not?p. 290
Considering Virtual Considerationsp. 293
Factoring Classesp. 295
Factoringp. 296
Implementing Abstract Classesp. 300
Describing the abstract class conceptp. 302
Making an honest class out of an abstract classp. 303
Passing abstract classesp. 305
Declaring pure virtual functions--is it really necessary?p. 306
Trying to Rationalize My Budget: BUDGET3.CPPp. 308
Optional Featuresp. 319
Overloading Operatorsp. 321
Overloading Operators--Can't We Live Together in Harmony?p. 322
How Does an Operator Function and a Function Operate?p. 323
Taking a More Detailed Lookp. 326
Considering the operator+O casep. 326
Considering the operator++O casep. 328
Coding Operators as Member Functionsp. 329
Suffering through Yet Another Overloading Irritationp. 331
Overloading Operators Using Implicit Conversionp. 332
Promoting user defined objectsp. 333
Defining a Cast Operatorp. 334
Defining the rules for implicit conversionsp. 335
Overloading the Assignment Operatorp. 337
Overloading the Assignment Operator Is Criticalp. 337
Finding Out How to Overload the Assignment Operatorp. 338
Creating shallow copies is a deep problemp. 340
Going to C++ member-by-memberp. 341
Returning from over-C's assignmentsp. 342
Providing member protectionp. 342
Using Stream I/Op. 345
Diving into Stream I/Op. 345
Examining the fstream Subclassesp. 348
Using the strstream Subclassesp. 351
Manipulating Manipulatorsp. 353
Writing Custom Insertersp. 356
Generating Smart Insertersp. 359
Handling Errors--Exceptionsp. 361
Justifying a New Error Mechanism?p. 362
Examining the Exception Mechanismp. 364
What Kinds of Things Can I Throw?p. 366
Inheriting Multiple Inheritancep. 369
Describing the Multiple Inheritance Mechanismp. 369
Straightening Out Inheritance Ambiguitiesp. 371
Adding Virtual Inheritancep. 372
Constructing the Objects of Multiple Inheritancep. 377
Voicing a Contrary Opinionp. 377
The Part of Tensp. 381
Ten Ways to Avoid Adding Bugs to Your Programp. 383
Enabling All Warnings and Error Messagesp. 383
Insisting on Clean Compilesp. 384
Adopting a Clear and Consistent Coding Stylep. 384
Limiting the Visibilityp. 385
Commenting Your Code While You Write Itp. 386
Single-Stepping Every Path at Least Oncep. 387
Avoid Overloading Operatorsp. 387
Heap Handlingp. 388
Using Exceptions to Handle Errorsp. 388
Avoiding Multiple Inheritancep. 388
The Ten Most Important Microsoft Visual C++ Compiler Settingsp. 389
Generating a Command Line Programp. 390
Changing Project Settingsp. 390
Choosing General Settingsp. 391
Selecting Settings for Debugp. 392
Choosing General Options for C/C++p. 393
Controlling C++ Language Settingsp. 394
Choosing Code Generation Settingsp. 395
Customizing with the Code Generation Windowp. 396
Controlling Compile Optimizationsp. 396
Selecting Precompiled Headersp. 397
About the CD-ROMp. 399
System Requirementsp. 399
Using the CD with Microsoft Windowsp. 399
What You'll Findp. 400
If You've Got Problems (Of the CD Kind)p. 401
Glossaryp. 403
Indexp. 407
IDG Books Worldwide End-User License Agreementp. 426
GNU General Public Licensep. 428
Installation Instructionsp. 433
Book Registration Information
Table of Contents provided by Syndetics. All Rights Reserved.

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