did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780470317358

C++ All-In-One Desk Reference For Dummies

by ;
  • ISBN13:

    9780470317358

  • ISBN10:

    0470317353

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2009-08-31
  • 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: $39.99

Summary

Making Everything Easier!2nd EditionC++ all-in-one for Dummies7 books in 1Introducing C++Understanding Objects and ClassesFixing ProblemsAdvanced ProgrammingReading and Writing FilesAdvanced C++Building Applications with Microsoft MFCJohn Paul MuellerJeff CogswellC++ is the "in" language!Find out why, andhow to use it, right hereC++ is fast, powerful, and fully compiled - three great reasons why it's #1. There are more reasons, and in this guide you discover them as you dig in and really learn to use C++. Each handy minibook covers what you need to know about a key aspect of C++. If you're a C++ newbie, start with Book I; experienced folks can jump in anywhere to learn more!One size fits most - see how to use C++ for Windowsr, Macr, and Linuxr, using the CodeBlocks compilerExplore objects and classes - understand object-oriented programming and how to use various diagrams to design your programsBanish bugs - learn to use a debugger and how the CodeBlocks debugger ferrets out problems in your applicationsReading and writing - Minibook V covers it all, including stream programmingAdvance to the Library - understand how to create your own templates and build a full set of libraries for your own useBonus CD IncludesAll source code from the examples used in the bookCodeBlocks compilerPlease see the CD appendix for details and complete system requirements.

Author Biography

John Paul Mueller has written more than 300 articles and 80 books on technology, including LINQ For Dummies. Jeff Cogswell has been an application developer and trainer for 13 years, working with clients from startups to Fortune 500 companies. He has developed courses on C++ and other technologies.

Table of Contents

Introductionp. 1
No Experience Necessaryp. 1
Great for Advanced Folks, Too!p. 1
For All Computersp. 2
Conventionsp. 2
Organizationp. 3
Icons Galorep. 4
What's Next?p. 5
Introducing C++p. 7
Creating a First C++ Programp. 9
Creating a Projectp. 9
Understanding projectsp. 10
Defining your first projectp. 10
Building and executing your first applicationp. 15
Typing the Codep. 16
Starting with Mainp. 17
Showing Informationp. 18
Doing some mathp. 22
Tabbing your outputp. 26
Let Your Program Run Awayp. 27
Storing Data in C++p. 29
Putting Your Data Places: Variablesp. 30
Creating an integer variablep. 30
Declaring multiple variablesp. 33
Changing valuesp. 33
Setting one variable equal to anotherp. 34
Initializing a variablep. 35
Creating a great name for yourselfp. 36
Manipulating Integer Variablesp. 37
Adding integer variablesp. 38
Subtracting integer variablesp. 41
Multiplying integer variablesp. 43
Dividing integer variablesp. 43
Charactersp. 45
Null characterp. 46
Nonprintable and other cool charactersp. 46
Stringsp. 48
Getting a part of a stringp. 49
Changing part of a stringp. 51
Adding onto a stringp. 51
Adding two stringsp. 52
Deciding between Conditional Operatorsp. 52
Telling the Truth with Boolean Variablesp. 55
Reading from the Consolep. 56
Directing Your C++ Program Flowp. 59
Doing This or Doing Thatp. 60
Evaluating Conditions in C++p. 60
Finding the right C++ operatorsp. 61
Combining multiple evaluationsp. 62
Including Evaluations in C++ Conditional Statementsp. 63
Deciding what if and also what elsep. 64
Going further with the else and ifp. 65
Repeating Actions with Statements That Loopp. 67
Looping situationsp. 67
Looping forp. 68
Looping whilep. 74
Doing whilep. 77
Breaking and continuingp. 77
Nesting loopsp. 79
Dividing Your Work with Functionsp. 83
Dividing Your Workp. 83
Calling a Functionp. 88
Passing a variablep. 89
Passing multiple variablesp. 90
Writing Your Own Functionsp. 91
Multiple parameters or no parametersp. 95
Returning nothingp. 97
Keeping your variables localp. 98
Forward references and function prototypesp. 100
Writing two versions of the same functionp. 101
Calling All String Functionsp. 103
Understanding mainp. 105
Dividing Between Source-Code Filesp. 109
Creating Multiple Source Filesp. 109
Multiple source files in CodeBlocksp. 110
Multiple source files in other compilersp. 112
Creating multiple filesp. 113
Sharing with Header Filesp. 115
Adding the header only oncep. 118
Using brackets or quotesp. 118
Sharing Variables Among Source Filesp. 119
Using the Mysterious Header Wrappersp. 121
Referring to Your Data through Pointersp. 123
Heaping and Stacking the Variablesp. 124
Getting a variable's addressp. 127
Changing a variable by using a pointerp. 129
Pointing at a stringp. 131
Pointing to something elsep. 133
Tips on pointer variablesp. 134
Dynamically Allocating with newp. 135
Using newp. 135
Using an initializerp. 137
Making new stringsp. 138
Freeing Pointersp. 139
Passing Pointer Variables to Functionsp. 141
Changing variable values with pointersp. 141
Modifying string parametersp. 144
Returning Pointer Variables from Functionsp. 145
Returning a Pointer as a Nonpointerp. 148
Passing by Referencep. 149
Remembering the Rulesp. 150
Working with Classesp. 151
Understanding Objects and Classesp. 151
Classifying classes and objectsp. 153
Describing member functions and datap. 154
Implementing a classp. 156
Separating member function codep. 160
The parts of a classp. 163
Working with a Classp. 164
Accessing membersp. 164
Using classes and pointersp. 167
Passing objects to functionsp. 170
Using const parameters in functionsp. 172
Using the this pointerp. 173
Overloading member functionsp. 175
Starting and Ending with Constructors and Destructorsp. 178
Starting with constructorsp. 178
Ending with destructorsp. 178
Sampling constructors and destructorsp. 179
Adding parameters to constructorsp. 181
Building Hierarchies of Classesp. 182
Creating a hierarchy in C++p. 183
Understanding types of inheritancep. 184
Using Advanced C++ Featuresp. 187
Filling Your Code with Commentsp. 187
Converting Typesp. 189
Reading from the Consolep. 195
Understanding Preprocessor Directivesp. 199
Using Constantsp. 207
Using Switch Statementsp. 209
Supercharging enums with Classesp. 212
Working with Random Numbersp. 215
Storing Data in Arraysp. 216
Declaring and accessing an arrayp. 217
Arrays of pointersp. 218
Passing arrays to functionsp. 219
Adding and subtracting pointersp. 221
Understanding Objects and Classesp. 223
Planning and Building Objectsp. 225
Recognizing Objectsp. 225
Observing the mailboxes classp. 227
Observing the mailbox classp. 229
Finding other objectsp. 230
Encapsulating Objectsp. 230
Building Hierarchiesp. 236
Establishing a hierarchyp. 236
Protecting members when inheritingp. 238
Overriding member functionsp. 243
Specializing with polymorphismp. 245
Getting abstract about thingsp. 247
Discovering Classesp. 248
Engineering your softwarep. 249
Finding those pesky classesp. 252
Describing Your Program with UMLp. 255
Moving Up to UMLp. 255
Modeling with UMLp. 259
Diagramming and designing with UMLp. 259
Building with UML and the Unified Processp. 264
Speaking iterativelyp. 266
Phasing in and outp. 267
The inception phasep. 269
The elaboration phasep. 270
The construction phasep. 271
The transition phasep. 272
Moving Forward with UMLp. 273
Structuring Your Classes with UMLp. 275
Drawing Classesp. 276
Mapping classes with UMLp. 277
Inheriting in UMLp. 280
Aggregating and composing classesp. 281
Building Componentsp. 282
Deploying the Softwarep. 285
Demonstrating Behavior with UMLp. 287
Drawing Objectsp. 287
Casing Out the Use Casesp. 289
Expanding use casesp. 291
Matching use cases and requirementsp. 292
Sequence Diagramsp. 293
Notating sequence diagramsp. 295
Looping and comparing in sequence diagramsp. 296
Collaboration Diagramsp. 299
Activity Diagramsp. 300
State Diagramsp. 302
Modeling Your Programs with UMLp. 305
Using UML Goodiesp. 305
Packaging your symbolsp. 305
Notating your diagramsp. 308
Tagging your symbolsp. 308
Free to Be UMLp. 309
C++ and UMLp. 312
Drawing enumerationsp. 312
Including static membersp. 312
Parameterizing classes with templatesp. 314
Building with Design Patternsp. 317
Introducing a Simple Pattern: the Singletonp. 318
Watching an Instance with an Observerp. 322
Observers and the Standard C++ Libraryp. 326
Automatically adding an observerp. 327
Mediating with a Patternp. 330
Fixing Problemsp. 347
Dealing with Bugsp. 349
It's Not a Bug, It's a Feature!p. 349
Make Your Programming Features Look Like Featuresp. 351
Anticipating (Almost) Everythingp. 352
Avoiding Mistakes, Plain and Simplep. 359
Debugging a Programp. 361
Programming with Debuggersp. 361
Running the debuggerp. 363
Recognizing the parts of the CodeBlocks debuggerp. 369
Debugging with Different Toolsp. 371
Standard debuggersp. 371
Stopping and Inspecting Your Codep. 373
Setting and Disabling Breakpointsp. 374
Setting a breakpoint in CodeBlocksp. 375
Enabling and disabling breakpointsp. 376
Watching, Inspecting, and Changing Variablesp. 378
Watching the local variablesp. 380
Watching other variablesp. 382
Traveling About the Stackp. 385
Stacking Your Datap. 385
Moving about the stackp. 386
Storing local variablesp. 388
Debugging with Advanced Featuresp. 390
Viewing threadsp. 390
Tracing through assembly codep. 391
Advanced Programmingp. 395
Working with Arrays, Pointers, and Referencesp. 397
Building Up Arraysp. 397
Declaring arraysp. 398
Arrays and pointersp. 400
Using multidimensional arraysp. 403
Arrays and command-line parametersp. 406
Allocating an array on the heapp. 407
Storing arrays of pointers and arrays of arraysp. 409
Building constant arraysp. 411
Pointing with Pointersp. 413
Becoming horribly complexp. 413
Pointers to functionsp. 418
Pointing a variable to a member functionp. 419
Pointing to static member functionsp. 422
Referring to Referencesp. 422
Reference variablesp. 423
Returning a reference from a functionp. 424
Creating Data Structuresp. 427
Working with Datap. 427
The great variable roundupp. 427
Expressing variables from either sidep. 429
Casting a spell on your datap. 431
Casting safely with C++p. 433
Dynamically casting with dynamic_castp. 433
Statically casting with static_castp. 437
Structuring Your Datap. 438
Structures as component data typesp. 439
Equating structuresp. 440
Returning compound data typesp. 441
Naming Your Spacep. 442
Using variables and part of a namespacep. 445
Constructors, Destructors, and Exceptionsp. 449
Constructing and Destructing Objectsp. 449
Overloading constructorsp. 450
Initializing membersp. 451
Adding a default constructorp. 455
Functional constructorsp. 458
Calling one constructor from anotherp. 460
Copying instances with copy constructorsp. 461
When constructors go bad: failable constructors?p. 464
Destroying your instancesp. 465
Virtually inheriting destructorsp. 466
Programming the Exceptions to the Rulep. 469
Throwing direct instancesp. 472
Catching any exceptionp. 473
Rethrowing an exceptionp. 474
Advanced Class Usagep. 477
Inherently Inheriting Correctlyp. 477
Morphing your inheritancep. 477
Adjusting accessp. 480
Returning something different, virtually speakingp. 482
Multiple inheritancep. 486
Virtual inheritancep. 489
Friend classes and functionsp. 492
Using Classes and Types within Classesp. 493
Nesting a classp. 494
Types within classesp. 499
Creating Classes with Templatesp. 503
Templatizing a Classp. 503
Separating a template from the function codep. 510
Including static members in a templatep. 512
Parameterizing a Templatep. 514
Putting different types in the parameterp. 514
Including multiple parametersp. 518
Typedefing a Templatep. 521
Deriving Templatesp. 522
Deriving classes from a class templatep. 522
Deriving a class template from a classp. 524
Deriving a class template from a class templatep. 525
Templatizing a Functionp. 528
Overloading and function templatesp. 530
Templatizing a member functionp. 533
Programming with the Standard Libraryp. 535
Architecting the Standard Libraryp. 536
Containing Your Classesp. 536
Storing in a vectorp. 536
Mapping your datap. 538
Containing instances, pointers, or referencesp. 539
Comparing instancesp. 543
Iterating through a containerp. 547
A map of pairs in your handp. 551
The Great Container Showdownp. 551
Associating and storing with a setp. 552
Unionizing and intersecting setsp. 554
Listing with listp. 557
Stacking the dequep. 561
Waiting in line with stacks and queuesp. 562
Copying Containersp. 564
Reading and Writing Filesp. 567
Filing Information with the Streams Libraryp. 569
Seeing a Need for Streamsp. 570
Programming with the Streams Libraryp. 571
Getting the right header filep. 572
Opening a filep. 573
Handling Errors When Opening a Filep. 576
Flagging the ios Flagsp. 578
Writing with Output Streamsp. 583
Inserting with the << Operatorp. 583
Formatting Your Outputp. 585
Formatting with flagsp. 586
Specifying a precisionp. 590
Setting the width and creating fieldsp. 592
Reading with Input Streamsp. 597
Extracting with Operatorsp. 597
Encountering the End of Filep. 599
Reading Various Typesp. 604
Reading Formatted Inputp. 607
Building Directories and Contentsp. 609
Manipulating Directoriesp. 610
Creating a directoryp. 610
Deleting a directoryp. 611
Getting the Contents of a Directoryp. 611
Copying Filesp. 614
Moving and Renaming Files and Directoriesp. 616
Streaming Your Own Classesp. 619
Streaming a Class for Text Formattingp. 620
Manipulating a Streamp. 623
What's a manipulator?p. 623
Writing your own manipulatorp. 626
Advanced C++p. 631
Exploring the Standard Library Furtherp. 633
Considering the Standard Library Categoriesp. 634
Containersp. 635
Iteratorsp. 635
Algorithmsp. 636
Functorsp. 637
Utilitiesp. 639
Adaptorsp. 639
Allocatorsp. 639
Parsing Strings Using a Hashp. 640
Obtaining Information Using a Random Access Iteratorp. 643
Locating Values Using the Find Algorithmp. 645
Using the Random Number Generatorp. 647
Performing Comparisons Using min and maxp. 648
Working with Temporary Buffersp. 649
Building Original Templatesp. 651
Deciding When to Create a Templatep. 652
Defining the Elements of a Good Templatep. 653
Creating a Basic Math Templatep. 655
Building a Structure Templatep. 656
Developing a Class Templatep. 659
Considering Template Specializationp. 662
Creating a Template Libraryp. 664
Defining the library projectp. 664
Configuring the library projectp. 666
Coding the libraryp. 667
Using Your Template Libraryp. 669
Investigating Boostp. 671
Understanding Boostp. 672
Boost featuresp. 672
Licensingp. 673
Paid supportp. 673
Obtaining and Installing Boost for CodeBlocksp. 673
Unpacking Boostp. 674
Building the librariesp. 675
Building the Boost toolsp. 678
Using Boost Jamp. 680
Using Boost Buildp. 682
Using Regressionp. 685
Using Inspectp. 685
Understanding BoostBookp. 687
Using QuickBookp. 689
Using bcpp. 690
Using Wavep. 692
Building Your First Boost Application Using Date Timep. 693
Boosting up a Stepp. 697
Parsing Strings Using RegExp. 698
Adding the RegEx libraryp. 699
Creating the RegEx codep. 700
Breaking Strings into Tokens Using Tokenizerp. 702
Performing Numeric Conversionp. 703
Creating Improved Loops Using Foreachp. 706
Accessing the Operating System Using Filesystemp. 708
Building Applications with Microsoft MFCp. 713
Working with the Visual C++ 2008 IDE and Projectsp. 715
Understanding the Project Typesp. 716
Creating a New Win32 Console Applicationp. 717
Defining the projectp. 717
Adding codep. 719
Running the applicationp. 720
Writing Code Fasterp. 721
Obtaining coding helpp. 721
Working with IntelliSensep. 722
Viewing Your Project in Solution Explorerp. 723
Using the Standard Toolbarsp. 724
Changing Application Propertiesp. 725
Modifying the IDE Appearancep. 726
Changing toolbars and menusp. 726
Modifying windowsp. 728
Creating an MFC Dialog Box Projectp. 731
Understanding the MFC Dialog Box Projectp. 731
Creating the MFC Dialog Box Projectp. 732
Adding Components and Controlsp. 738
Adding the component or controlp. 738
Creating variables to use in your codep. 741
Defining methods to react to control eventsp. 742
Defining the Dialog Box Codep. 743
Understanding the Essential Windowsp. 745
Working with Class Viewp. 745
Modifying the Toolboxp. 746
Creating an MFC SDI Projectp. 747
Understanding the MFC SDI Projectp. 747
Creating the MFC SDI Projectp. 749
Understanding the Document/View Architecturep. 756
Adding Code to Your SDI Projectp. 757
An overview of the essential application filesp. 757
Locating Microsoft specified suggested changesp. 759
Making resource changesp. 760
Considering the help filep. 763
Registering and unregistering the applicationp. 765
Seeing the Text Editor Project in Actionp. 766
Using the Visual C++ 2008 Debuggerp. 769
A Quick Look at the Error Applicationp. 770
Starting Your Application in Debugging Modep. 771
Creating the proper buildp. 772
Setting breakpointsp. 772
Viewing your breakpointsp. 774
Starting the debuggerp. 775
Working with the Debugging Windowsp. 775
Viewing the focus variables using the Autos windowp. 775
Viewing all of the variables in a method using the Locals windowp. 777
Screening specific variables using the Watch 1 windowp. 777
Working with the Call Stack windowp. 778
Analyzing Your Visual C++ 2008 Codep. 779
Using Performance Wizardp. 779
Profiling the Codep. 781
Automating Your Programs with Makefilesp. 785
Compiling and Linkingp. 785
Automating Your Workp. 787
Implying with Inference Rulesp. 788
Using rules that depend on other rulesp. 790
Making specific itemsp. 791
Depending on multiple filesp. 791
Compiling and linking with makep. 793
Cleaning up and making it allp. 793
Using macrosp. 794
Getting the most out of Makefilesp. 795
About the CDp. 797
System Requirementsp. 797
Using the CDp. 798
What You'll Find on the CDp. 798
CodeBlocks Compilerp. 799
Author-created materialp. 799
Troubleshootingp. 799
Customer Carep. 800
Indexp. 801
Table of Contents provided by Ingram. 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