close menu
Bookswagon-24x7 online bookstore
close menu
My Account
28%
Beginning Programming with C++ For Dummies: (For Dummies (Computers))

Beginning Programming with C++ For Dummies: (For Dummies (Computers))

4.5       |  6 Reviews 
5
4
3
2
1

Premium quality
Premium quality
Bookswagon upholds the quality by delivering untarnished books. Quality, services and satisfaction are everything for us!
Easy Return
Easy return
Not satisfied with this product! Keep it in original condition and packaging to avail easy return policy.
Certified product
Certified product
First impression is the last impression! Address the book’s certification page, ISBN, publisher’s name, copyright page and print quality.
Secure Checkout
Secure checkout
Security at its finest! Login, browse, purchase and pay, every step is safe and secured.
Money back guarantee
Money-back guarantee:
It’s all about customers! For any kind of bad experience with the product, get your actual amount back after returning the product.
On time delivery
On-time delivery
At your doorstep on time! Get this book delivered without any delay.
Quantity:
Add to Wishlist

About the Book

Learn to program with C++ quickly with this helpful For Dummies guide

Beginning Programming with C++ For Dummies, 2nd Edition gives you plain-English explanations of the fundamental principles of C++, arming you with the skills and know-how to expertly use one of the world's most popular programming languages. You'll explore what goes into creating a program, how to put the pieces together, learn how to deal with standard programming challenges, and much more.

Written by the bestselling author of C++ For Dummies, this updated guide explores the basic development concepts and techniques of C++ from a beginner's point of view, and helps make sense of the how and why of C++ programming from the ground up. Beginning with an introduction to how programming languages function, the book goes on to explore how to work with integer expressions and character expressions, keep errors out of your code, use loops and functions, divide your code into modules, and become a functional programmer.

  • Grasp C++ programming like a pro, even if you've never written a line of code
  • Master basic development concepts and techniques in C++
  • Get rid of bugs and write programs that work
  • Find all the code from the book and an updated C++ compiler on the companion website

If you're a student or first-time programmer looking to master this object-oriented programming language, Beginning Programming with C++ For Dummies, 2nd Edition has you covered.



Table of Contents:

Introduction 1

About This Book 1

Foolish Assumptions 2

How This Book Is Organized 3

Part I: Getting Started with C++ Programming 3

Part II: Writing a Program: Decisions, Decisions 4

Part III: Becoming a Procedural Programmer 4

Part IV: Data Structures 4

Part V: Object-Oriented Programming 4

Part VI: Advanced Strokes 5

Part VII: The Part of Tens 5

Icons Used in This Book 5

Beyond the Book 6

Where to Go from Here 6

Part I: Getting Started with C++ Programming 7

Chapter 1: What Is a Program? 9

How Does My Son Differ from a Computer? 9

Programming a “Human Computer” 11

Creating the algorithm 11

Setting the tire-changing language 12

Constructing the program 13

Computer processors 17

Computer Languages 17

High-level languages 19

The C++ language 20

Chapter 2: Installing Code::Blocks 21

Reviewing the Compilation Process 21

Installing Code::Blocks 23

Windows installation 23

Ubuntu Linux installation 26

Mac OS installation 27

Setting up Code::Blocks 31

Testing the Code::Blocks Installation 33

Creating the project 34

Testing your default project 37

Chapter 3: Writing Your First Program 41

Creating a New Project 41

Filename extensions 43

Entering Your Program 44

Building the Program 46

Finding What Could Go Wrong 47

Misspelled commands 47

Missing semicolon 49

Using the Online Material 50

Running the Program 51

How the Program Works 51

The template 51

The Conversion program 53

Part II: Writing a Program: Decisions, Decisions 55

Chapter 4: Integer Expressions 57

Declaring Variables 57

Variable names 58

Assigning a value to a variable 59

Initializing a variable at declaration 60

Integer Constants 61

Expressions 62

Binary operators 62

Unraveling compound expressions 63

Unary Operators 65

The Special Assignment Operators 67

Chapter 5: Character Expressions 69

Defining Character Variables 69

Encoding characters 70

Example of character encoding 73

Encoding Strings of Characters 75

Special Character Constants 75

Chapter 6: if I Could Make My Own Decisions 79

The if Statement 79

Comparison operators 80

Say “No” to “No braces” 83

What Else Is There? 84

Nesting if Statements 86

Compound Conditional Expressions 89

Chapter 7: Switching Paths 93

Controlling Flow with the switch Statement 93

Control Fell Through: Did I break It? 96

Implementing an Example Calculator with the switch Statement 97

Chapter 8: Debugging Your Programs, Part I 101

Identifying Types of Errors 101

Avoiding Introducing Errors 102

Coding with style 102

Establishing variable naming conventions 103

Finding the First Error with a Little Help 104

Finding the Run-Time Error 105

Formulating test data 106

Executing the test cases 106

Seeing what’s going on in your program 107

Part III: Becoming a Procedural Programmer 109

Chapter 9: while Running in Circles 111

Creating a while Loop 111

Breaking out of the Middle of a Loop 114

Nested Loops 117

Chapter 10: Looping for the Fun of It 121

The for Parts of Every Loop 121

Looking at an Example 123

Getting More Done with the Comma Operator 125

Chapter 11: Functions, I Declare! 129

Breaking Your Problem Down into Functions 129

Understanding How Functions Are Useful 130

Writing and Using a Function 131

Returning things 132

Reviewing an example 133

Passing Arguments to Functions 135

Function with arguments 136

Functions with multiple arguments 137

Exposing main() 137

Defining Function Prototype Declarations 139

Chapter 12: Dividing Programs into Modules 141

Breaking Programs Apart 141

Breaking Up Isn’t That Hard to Do 142

Creating Factorialcpp 143

Creating an #include file 145

Including #include files 146

Creating maincpp 148

Building the result 149

Using the Standard C++ Library 149

Variable Scope 150

Chapter 13: Debugging Your Programs, Par t 2 151

Debugging a Dys-Functional Program 151

Performing unit level testing 153

Outfitting a function for testing 155

Returning to unit test 159

Part IV: Data Structures 163

Chapter 14: Other Numerical Variable Types 165

The Limitations of Integers in C++ 165

Integer round-off 166

Limited range 166

A Type That “doubles” as a Real Number 167

Solving the truncation problem 168

When an integer is not an integer 168

Discovering the limits of double 169

Variable Size — the “long” and “short” of It 172

How far do numbers range? 174

Types of Constants 175

Passing Different Types to Functions 176

Overloading function names 177

Mixed-mode overloading 177

Chapter 15: Arrays 181

What Is an Array? 181

Declaring an Array 182

Indexing into an Array 183

Looking at an Example 184

Initializing an Array 187

Chapter 16: Arrays with Character 189

The ASCII-Zero Character Array 189

Declaring and Initializing an ASCIIZ Array 190

Looking at an Example 191

Looking at a More Detailed Example 193

Foiling hackers 197

Do I Really Have to Do All That Work? 198

Chapter 17: Pointing the Way to C++ Pointers 203

What’s a Pointer? 203

Declaring a Pointer 204

Passing Arguments to a Function 206

Passing arguments by value 206

Passing arguments by reference 209

Putting it together 211

Reference argument types 213

Playing with Heaps of Memory 214

Do you really need a new keyword? 214

Don’t forget to clean up after yourself 215

Looking at an example 216

Chapter 18: Taking a Second Look at C++ Pointers 221

Pointers and Arrays 221

Operations on pointers 222

Pointer addition versus indexing into an array 224

Using the pointer increment operator 227

Why bother with array pointers? 230

Operations on Different Pointer Types 231

Constant Nags 231

Differences Between Pointers and Arrays 233

My main() Arguments 233

Arrays of pointers 234

Arrays of arguments 235

Chapter 19: Programming with Class 241

Grouping Data 241

The Class 242

The Object 243

Arrays of Objects 244

Looking at an Example 246

Chapter 20: Debugging Your Programs, Par t 3 253

A New Approach to Debugging 253

The solution 254

Entomology for Dummies 255

Starting the debugger 257

Fixing the (first) bug 264

Finding and fixing the second bug 265

Part V: Object-Oriented Programming 269

Chapter 21: What Is Object-Oriented Programming? 271

Abstraction and Microwave Ovens 271

Procedural nachos 273

Object-oriented nachos 273

Classification and Microwave Ovens 274

Why Build Objects This Way? 275

Self-Contained Classes 276

Chapter 22: Structured Play: Making Classes Do Things 277

Activating Our Objects 277

Creating a Member Function 278

Defining a member function 279

Naming class members 280

Calling a member function 281

Accessing other members from within a member function 282

Keeping a Member Function after Class 284

Overloading Member Functions 285

Chapter 23: Pointers to Objects 287

Pointers to Objects 287

Arrow syntax 288

Calling all member functions 288

Passing Objects to Functions 289

Calling a function with an object value 289

Calling a function with an object pointer 290

Looking at an example 292

Allocating Objects off the Heap 296

Chapter 24: Do Not Disturb: Protected Members 299

Protecting Members 299

Why you need protected members 300

Making members protected 301

So what? 303

Who Needs Friends, Anyway? 304

Chapter 25: Getting Objects Off to a Good Start 307

The Constructor 308

Limitations on constructors 309

Can I see an example? 310

Constructing data members 312

Destructors 315

Looking at an example 316

Destructing data members 318

Chapter 26: Making Constructive Arguments 321

Constructors with Arguments 321

Looking at an example 322

Overloading the Constructor 326

The Default default Constructor 330

Constructing Data Members 332

Initializing data members with the default constructor 332

Initializing data members with a different constructor 334

Looking at an example 337

New with C++ 2011 340

Chapter 27: Coping with the Copy Constructor 341

Copying an Object 341

The default copy constructor 342

Looking at an example 344

Creating a Copy Constructor 346

Avoiding Copies 349

Part VI: Advanced Strokes 351

Chapter 28: Inheriting a Class 353

Advantages of Inheritance 354

Learning the lingo 355

Implementing Inheritance in C++ 355

Looking at an example 356

Having a HAS_A Relationship 360

Chapter 29: Are Virtual Functions for Real? 361

Overriding Member Functions 361

Early binding 362

Ambiguous case 364

Enter late binding 366

When Is Virtual Not? 369

Virtual Considerations 371

Chapter 30: Overloading Assignment Operators 373

Overloading an Operator 374

Overloading the Assignment Operator Is Critical 374

Looking at an Example 376

Writing Your Own (or Not) 379

Chapter 31: Performing Streaming I/O 381

How Stream I/O Works 381

Stream Input/Output 383

Creating an input object 383

Creating an output object 385

Open modes 386

What is binary mode? 386

Hey, file, what state are you in? 387

Other Member Functions of the fstream Classes 391

Reading and writing streams directly 393

Controlling format 396

What’s up with endl? 399

Manipulating Manipulators 399

Using the stringstream Classes 400

Chapter 32: I Take Exception! 405

The Exception Mechanism 406

Examining the exception mechanism in detail 408

Special considerations for throwing 409

Creating a Custom Exception Class 410

Restrictions on exception classes 414

Part VII: The Part of Tens 415

Chapter 33: Ten Ways to Avoid Bugs 417

Enable All Warnings and Error Messages 417

Adopt a Clear and Consistent Coding Style 418

Comment the Code While You Write It 419

Single-Step Every Path in the Debugger at Least Once 419

Limit the Visibility 420

Keep Track of Heap Memory 420

Zero Out Pointers after Deleting What They Point To 421

Use Exceptions to Handle Errors 421

Declare Destructors Virtual 422

Provide a Copy Constructor and Overloaded Assignment Operator 422

Chapter 34: Ten Features Not Covered in This Book 423

The goto Command 423

The Ternary Operator 424

Binary Logic 425

Enumerated Types 425

Namespaces 425

Pure Virtual Functions 426

The string Class 426

Multiple Inheritance 427

Templates and the Standard Template Library 427

Lambda Functions 428

Index 429


Best Seller

| | See All

Product Details
  • ISBN-13: 9781118823873
  • Publisher: John Wiley & Sons Inc
  • Publisher Imprint: For Dummies
  • Depth: 25
  • Height: 232 mm
  • No of Pages: 464
  • Series Title: For Dummies (Computers)
  • Weight: 828 gr
  • ISBN-10: 1118823877
  • Publisher Date: 23 Dec 2014
  • Binding: Paperback
  • Edition: 2
  • Language: English
  • Returnable: N
  • Spine Width: 28 mm
  • Width: 182 mm


Similar Products

How would you rate your experience shopping for books on Bookswagon?

Add Photo
Add Photo

Customer Reviews

4.5       |  6 Reviews 
out of (%) reviewers recommend this product
Top Reviews
Rating Snapshot
Select a row below to filter reviews.
5
4
3
2
1
Average Customer Ratings
4.5       |  6 Reviews 
00 of 0 Reviews
Sort by :
Active Filters

00 of 0 Reviews
SEARCH RESULTS
1–2 of 2 Reviews
    BoxerLover2 - 5 Days ago
    A Thrilling But Totally Believable Murder Mystery

    Read this in one evening. I had planned to do other things with my day, but it was impossible to put down. Every time I tried, I was drawn back to it in less than 5 minutes. I sobbed my eyes out the entire last 100 pages. Highly recommend!

    BoxerLover2 - 5 Days ago
    A Thrilling But Totally Believable Murder Mystery

    Read this in one evening. I had planned to do other things with my day, but it was impossible to put down. Every time I tried, I was drawn back to it in less than 5 minutes. I sobbed my eyes out the entire last 100 pages. Highly recommend!


Sample text
Photo of
    Media Viewer

    Sample text
    Reviews
    Reader Type:
    BoxerLover2
    00 of 0 review

    Your review was submitted!
    Beginning Programming with C++ For Dummies: (For Dummies (Computers))
    John Wiley & Sons Inc -
    Beginning Programming with C++ For Dummies: (For Dummies (Computers))
    Writing guidlines
    We want to publish your review, so please:
    • keep your review on the product. Review's that defame author's character will be rejected.
    • Keep your review focused on the product.
    • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
    • Refrain from mentioning competitors or the specific price you paid for the product.
    • Do not include any personally identifiable information, such as full names.

    Beginning Programming with C++ For Dummies: (For Dummies (Computers))

    Required fields are marked with *

    Review Title*
    Review
      Add Photo Add up to 6 photos
      Would you recommend this product to a friend?
      Tag this Book
      Read more
      Does your review contain spoilers?
      What type of reader best describes you?
      I agree to the terms & conditions
      You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

      CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

      These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


      By submitting any content to Bookswagon, you guarantee that:
      • You are the sole author and owner of the intellectual property rights in the content;
      • All "moral rights" that you may have in such content have been voluntarily waived by you;
      • All content that you post is accurate;
      • You are at least 13 years old;
      • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
      You further agree that you may not submit any content:
      • That is known by you to be false, inaccurate or misleading;
      • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
      • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
      • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
      • For which you were compensated or granted any consideration by any unapproved third party;
      • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
      • That contains any computer viruses, worms or other potentially damaging computer programs or files.
      You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


      For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


      All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

      Accept

      New Arrivals

      | | See All


      Inspired by your browsing history


      Your review has been submitted!

      You've already reviewed this product!
      ASK VIDYA