C++ Without Fear: A Beginner's Guide That Makes You Feel Smart

Learning C++ Doesn’t Have to Be Difficult!

 

Have you ever wanted to learn programming? Have you ever wanted to learn the C++ language behind many of today’s hottest games, business programs, and even advanced spacecraft? C++ Without Fear, Third Edition, is the ideal way to get started. Now updated for the newest C++14 standard and the free Microsoft Visual C++ Community Edition, it will quickly make you productive with C++ even if you’ve never written a line of code!

 

Brian Overland has earned rave reviews for this book’s approach to teaching C++. He starts with short, simple examples you can easily enter and run. Within a couple of chapters, you’ll be creating useful utilities, playing games, and solving puzzles. Everything’s simplified to its essentials, patiently explained, and clearly illustrated with practical examples and exercises that help you make progress quickly.

 

Overland reveals the “whys” and “tricks” behind each C++ language feature. And you’ll never get bogged down in complex or pointless examples: He keeps you 100% focused on learning what works and what matters—while having fun!

 

This new and improved edition

  • Covers installing and using the free Microsoft Visual C++ Community Edition— but you can use any version of C++
  • Explains valuable improvements in the new C++14 standard
  • Modularizes C++14 coverage so it’s easy to write code that works with older versions
  • Teaches with even more puzzles, games, and relevant exercises
  • Offers more “why” and “how-to” coverage of object orientation, today’s #1 approach to programming
  • Presents more ways to use Standard Template Library (STL) code to save time and get more done
  • Contains an expanded reference section for all your day-to-day programming

Whether you want to learn C++ programming for pleasure or you’re considering a career in programming, this book is an outstanding choice.

1124173931
C++ Without Fear: A Beginner's Guide That Makes You Feel Smart

Learning C++ Doesn’t Have to Be Difficult!

 

Have you ever wanted to learn programming? Have you ever wanted to learn the C++ language behind many of today’s hottest games, business programs, and even advanced spacecraft? C++ Without Fear, Third Edition, is the ideal way to get started. Now updated for the newest C++14 standard and the free Microsoft Visual C++ Community Edition, it will quickly make you productive with C++ even if you’ve never written a line of code!

 

Brian Overland has earned rave reviews for this book’s approach to teaching C++. He starts with short, simple examples you can easily enter and run. Within a couple of chapters, you’ll be creating useful utilities, playing games, and solving puzzles. Everything’s simplified to its essentials, patiently explained, and clearly illustrated with practical examples and exercises that help you make progress quickly.

 

Overland reveals the “whys” and “tricks” behind each C++ language feature. And you’ll never get bogged down in complex or pointless examples: He keeps you 100% focused on learning what works and what matters—while having fun!

 

This new and improved edition

  • Covers installing and using the free Microsoft Visual C++ Community Edition— but you can use any version of C++
  • Explains valuable improvements in the new C++14 standard
  • Modularizes C++14 coverage so it’s easy to write code that works with older versions
  • Teaches with even more puzzles, games, and relevant exercises
  • Offers more “why” and “how-to” coverage of object orientation, today’s #1 approach to programming
  • Presents more ways to use Standard Template Library (STL) code to save time and get more done
  • Contains an expanded reference section for all your day-to-day programming

Whether you want to learn C++ programming for pleasure or you’re considering a career in programming, this book is an outstanding choice.

33.99 In Stock
C++ Without Fear: A Beginner's Guide That Makes You Feel Smart

C++ Without Fear: A Beginner's Guide That Makes You Feel Smart

by Brian Overland
C++ Without Fear: A Beginner's Guide That Makes You Feel Smart

C++ Without Fear: A Beginner's Guide That Makes You Feel Smart

by Brian Overland

eBook

$33.99 

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Learning C++ Doesn’t Have to Be Difficult!

 

Have you ever wanted to learn programming? Have you ever wanted to learn the C++ language behind many of today’s hottest games, business programs, and even advanced spacecraft? C++ Without Fear, Third Edition, is the ideal way to get started. Now updated for the newest C++14 standard and the free Microsoft Visual C++ Community Edition, it will quickly make you productive with C++ even if you’ve never written a line of code!

 

Brian Overland has earned rave reviews for this book’s approach to teaching C++. He starts with short, simple examples you can easily enter and run. Within a couple of chapters, you’ll be creating useful utilities, playing games, and solving puzzles. Everything’s simplified to its essentials, patiently explained, and clearly illustrated with practical examples and exercises that help you make progress quickly.

 

Overland reveals the “whys” and “tricks” behind each C++ language feature. And you’ll never get bogged down in complex or pointless examples: He keeps you 100% focused on learning what works and what matters—while having fun!

 

This new and improved edition

  • Covers installing and using the free Microsoft Visual C++ Community Edition— but you can use any version of C++
  • Explains valuable improvements in the new C++14 standard
  • Modularizes C++14 coverage so it’s easy to write code that works with older versions
  • Teaches with even more puzzles, games, and relevant exercises
  • Offers more “why” and “how-to” coverage of object orientation, today’s #1 approach to programming
  • Presents more ways to use Standard Template Library (STL) code to save time and get more done
  • Contains an expanded reference section for all your day-to-day programming

Whether you want to learn C++ programming for pleasure or you’re considering a career in programming, this book is an outstanding choice.


Product Details

ISBN-13: 9780134318998
Publisher: Pearson Education
Publication date: 11/27/2015
Sold by: Barnes & Noble
Format: eBook
Pages: 624
File size: 29 MB
Note: This product may take a few minutes to download.
Age Range: 18 Years

About the Author

Brian Overland published his first article in a professional math journal at age 14.

 

After graduating from Yale, he began working on large commercial projects in C and Basic, including an irrigation-control system used all over the world. He also tutored students in math, computer programming, and writing, as well as lecturing to classes at Microsoft and at the community-college level. On the side, he found an outlet for his lifelong love of writing by publishing film and drama reviews in local newspapers. His qualifications as an author of technical books are nearly unique because they involve so much real programming and teaching experience, as well as writing.

 

In his 10 years at Microsoft, he was a tester, author, programmer, and manager. As a technical writer, he became an expert on advanced utilities, such as the linker and assembler, and was the “go-to” guy for writing about new technology. His biggest achievement was probably organizing the entire documentation set for Visual Basic 1.0 and having a leading role in teaching the “object-based” way of programming that was so new at the time. He was also a member of the Visual C++ 1.0 team.

 

Since then, he has been involved with the formation of new start-up companies (sometimes as CEO). He is currently working on a novel.

Read an Excerpt

In my ten years at Microsoft, I found the top-level programmers ("software development engineers," we called them) to be an interesting breed. Once you got them to open up and talk about their projects, they could be an articulate and passionate group.

The trick was to get beyond the initial barrier, to convince them that you spoke their language. Experienced programmers sometimes divide the world into two groups: those who are "technical" and those who are not. At times a yawning gap seems to exist between them, like that between people with perfect pitch and those without.

For programmers, the dividing line these days is most often the ability to program in C++. This attitude stems from the perception of C++ as difficult to learn.

This book is dedicated to the idea that C++ need not be difficult. It's often a more challenging language than Basic, to be sure, but with the right kind of help,you can master the tricks of C++.Why a New C++ Book?

Introductory programming books for C++ exist aplenty. But many—probably the great majority—are "introductory" only in the sense that they don't assume knowledge of C++ specifically. They usually assume that you've programmed in another language before, preferably in several.

This book does not make that assumption. All that's required is that you're comfortable with a computer and that you've run applications such as a word processor or e-mail reader.

Once you narrow the available C++ texts down to those that require no programming experience at all, there's a much smaller group of books from which to choose.What Else Is New about This Book?

The book you hold in your hand stresses the fundamentals ofprogramming. Yet even if you have programmed before (maybe you've taken a basic course in high school or college), you may find this a useful review. This book delves into thetopic of how to think like a programmer . . . and why specific language features matter. The why is as important as the how.

People learn best when they get the benefit of several learning methods reinforcing one another. Therefore, every topic in this book is introduced by a general discussion with short program-code examples, accompanied by the following:

  • A complete program example. Usually I provide a complete example that can be run and tested. The emphasis in this book is on short examples that do something interesting and useful and, when possible, something fun.
  • Programming exercises. Each example has a series of accompanying exercises, in which I encourage you to modify the example or write similar programs, so that from the beginning you're writing C++ code. Answers to these exercises provided on the accompanying CD in the folder "Example Code and Answers to Exercises."
  • Generous use of illustrations. Many so-called beginning texts don't use this approach at all. But I often find that the right figures can clarify an abstract concept. One picture is worth a thousand lectures, sometimes.
  • A special "How It Works" section for every major example in the book. How-to program texts are notorious for giving you a long example followed by a couple of paragraphs of text. That's not the approach of this book. Complete examples are listed so that you can see everything in context. But after each example, I go back and dissect the program a couple of lines at a time, explaining how and why each bit of the program does what it does.
Multiple Learning Paths: What Fits You Best

In addition to the multiple learning techniques just described, this book contains frequent Interludes, where the more curious reader will find additional background and explanations why C++ features work the way they do. If you're eager to just get C++ programs working, you may want to skip the Interludes and return to them later. One of the advantages of this book is that it accommodates multiple learning paths.

Unlike some texts, this book does not start with an exhaustive description of all language features such as data types, control structures, and operators. That would be like learning French by spending months memorizing nouns ratherthan learning to speak a complete sentence. This book focuses on getting real programs to work, right away.

At the same time, it's helpful to have access to a thorough-but-concise summary of language features. This book provides that summary in a series of convenient appendixes.What If You Already Have a Programming Background?

If you already know another programming language but are new to C++, that's not a problem. Certain ideas in programming never get old: what it means to think like a programmer, what's going on just beneath the surface, why the language is constructed the way it is. This review of programming fundamentals may be of interest anyway. But if not, you can speed through the first chapter or two. C++ gets challenging quickly enough.What Is Not Covered?

The goal of this book is to make you comfortable and conversant in C++, including objected-oriented programming features (classes and objects) that, although a relatively advanced topic, are at the heart of C++. The goal is not to teach every last bit of language syntax or to describe how every statement is translated into machine behavior (that is, how it is implemented), although in some places I do discuss that.

In my view, the good majority of beginning texts make the mistake of trying to cover every obscure corner of the language, even though there is ample room in intermediate to advanced books to handle those topics.

In case you are a C++ expert or otherwise a guru perusing this book, or you have some familiarity with the scope of the language, here is a summary of what's in C++ but is not covered in this book. (Consider this a "truth in advertising"disclaimer.)

  • Bit fields and bit operations. Bit operations can occasionally be useful for programs that must make extreme use of compact space, but in general, bit operations are rarely necessary. This is a good advanced topic. Likewise, I don't cover the union keyword (another feature used for compaction).
  • Windows and GUI programming. These are difficult subjects, deserving of their own book (or three). Visual C++ requires understanding of a complex architecture and thorough knowledge of object-oriented programming systems (OOPS). Reading this book first will give you a background in OOPS.
  • Templates and STL (Standard Template Library). This is another good topic for an advanced book. A template is a way of creating a generalized data structure in which an abstract mechanism can be combined with any number of specific data types. The template-defining capability was not originally in the C++ specification, although it is now standard.

Although this book does cover exception handling—a way to respond to runtime errors—I don't stress it, because it is most appropriate in complex programsand not likely to be as useful to a beginner.Why Should Anyone Start with C++?

Some people will tell you that C++ is unsuitable for beginners; therefore, unless you're in the elite of talented and experienced programmers, you shouldn't bother. I don't agree with that.

There are some good reasons for learning C++ early in your programming career. People used to spend a lot of time mastering the C language first. Yet C is rarely used for real work anymore. Now students learn it primarily as a stepping-stone to C++. But this makes little sense. You can pick up some bad habits learning C. It's better to go directly to C++. C++ is now the language of choice for systems programmers as well as for writing commercial software—including games, graphics, and business-oriented programs.

Some other languages (notably Microsoft's Visual Basic) are more forgiving. But as with C, Basic can encourage bad habits. C++ offers any learner some unique rewards.

  • Like the C language, C++ is a systems-programming language. In learning about C++ (at least in this book) you'll learn a lot about how things work in the computer and why they do.
  • Unlike C, C++ is a good implementation of object-oriented programming. This is an approach to programming in which you create intelligent data structures, especially well suited to things such as graphics programming. Object-oriented programming also lets you define new types that in effect expand the capabilities of the language itself. In learning object-oriented programming, you'll learn more about the current state of software design and where it's going.

The first half of this book focuses on the fundamentals of C++: how to get a program to work and accomplish basic tasks. From the beginning, however, it does get you to start using and understanding objects.

The second half focuses more completely on object-oriented programming, with special emphasis on how you can use it to write useful—and reusable—program code.To Get Started . . .

This book provides an added bonus: an accompanying CD with a free compiler, which is the language translator needed to write and execute programs in C++. All the programming examples in this book have been tested and retested with this compiler. The examples also work with compilers such as C++ in Microsoft Visual Studio.NET, although you'll need to follow the special instructions in Chapter 1 for use with that environment.

To install the free C++ compiler, just insert the CD into a PC and follow the instructions in the README.TXT file in the root directory.

This compiler is a free shareware version of GNU C++. You are free to use it to build and distribute your own programs. It also comes with a free development environment, so (as described in Chapter 1), you can write programs and then build them (translate them into executable form) at the touch of a single keystroke.Tips and Tricks: What Do I Watch Out For?

Perhaps what gives C-based languages their reputation for being more difficult than some others is that they have some "gotchas"—things that will catch you offguard if you don't have a friendly mentor standing next to you to steer you around the pitfalls.

As much as anything, this book is about keeping you safe from the gotchas. For too many people, the ability to program is gained only after making the same unnecessary mistakes over and over.

Above all, I hope to communicate some of what makes the subject, at least at times, so interesting. Software development can test your patience as you track down elusive bugs. But the concepts can be fascinating. In our new century, programming computers has become the new kind of craftsmanship, the new mode of fashioning fine tools, for a world that runs on information.

Table of Contents

Prefacexix
Why a New C++ Book?xix
What Else Is New about This Book?xx
Multiple Learning Paths: What Fits You Bestxx
What If You Already Have a Programming Background?xxi
What Is Not Covered?xxi
Why Should Anyone Start with C++?xxii
To Get Started...xxiii
Tips and Tricks: What Do I Watch Out For?xxiii
Acknowledgmentsxxv
Chapter 1Your First C++ Programs1
Thinking like a Programmer1
What's Different about C++?6
Building a C++ Program8
Installing Your Own C++ Compiler11
Example 1.1Print a Message12
Advancing to the Next Print Line17
Example 1.2Print Multiple Lines18
Storing Data: C++ Variables20
Introduction to Data Types21
Example 1.3Convert Temperatures23
A Word about Variable Names and Keywords29
Chapter 1 Summary30
Chapter 2Decisions, Decisions33
But First, a Few Words about Data Types33
Decision Making in Programs37
If and if-else37
Example 2.1Odd or Even?41
Introducing Loops44
Example 2.2Print 1 to N48
True and False in C++50
The Increment Operator (++)51
Statements vs. Expressions53
Introducing Boolean (Short-Circuit) Logic54
Example 2.3Testing a Person's Age56
Introducing the Math Library57
Example 2.4Prime-Number Test58
Chapter 2 Summary61
Chapter 3The Handy, All-Purpose "for" Statement65
Loops Used for Counting65
Introducing the "for" Loop66
A Wealth of Examples68
Example 3.1Printing 1 to N with "for"70
Statement Blocks with "for"71
Declaring Loop Variables on the Fly72
Example 3.2Prime-Number Test with "for"73
Comparative Languages 101: The Basic "for" Statement77
Chapter 3 Summary78
Chapter 4Functions: Many Are Called81
The Concept of Function81
Function Calls and the Flow of the Program83
The Basics of Using Functions84
Example 4.1Triangle-Number Function88
Example 4.2Prime-Number Function92
Local and Global Variables95
Recursive Functions97
Example 4.3Greatest Common Factor (GCF)98
Example 4.4Prime Factorization102
Example 4.5Random-Number Generator106
Chapter 4 Summary109
Chapter 5Arrays: We've Got Their Number111
A First Look at C++ Arrays111
Initializing Arrays113
Zero-Based Indexing114
Example 5.1Print Out Elements115
Example 5.2How Random Is Random?117
Strings and Arrays of Strings122
Example 5.3Card Dealer #1123
Example 5.4Card Dealer #2126
Example 5.5Card Dealer #3130
A Word to the Wise135
2-D Arrays: Into the Matrix136
Chapter 5 Summary137
Chapter 6Pointers: Getting a Handle on Data139
The Concept of Pointer139
Declaring and Using Pointers142
Example 6.1The Double-It Function145
Swap: Another Function Using Pointers147
Example 6.2Array Sorter149
Pointer Arithmetic154
Pointers and Array Processing156
Example 6.3Zero Out an Array157
Chapter 6 Summary161
Chapter 7Strings: Analyzing the Text163
Text Storage on the Computer163
It Don't Mean a Thing If It Ain't Got That String165
String-Manipulation Functions166
Example 7.1Building Strings168
Reading String Input172
Example 7.2Get a Number175
Example 7.3Convert to Uppercase177
Individual Characters vs. Strings180
Example 7.4Analyze Input181
The New C++ String Class186
Example 7.5Building Strings with the string Type189
Other Operations on the string Type191
Chapter 7 Summary193
Chapter 8Files: Electronic Storage197
Introducing File-Stream Objects197
How to Refer to Disk Files199
Example 8.1Write Text to a File200
Example 8.2Display a Text File200
Text Files vs. "Binary" Files203
Introducing Binary Operations208
Example 8.3Random-Access Write211
Example 8.4Random-Access Read214
Chapter 8 Summary217
Chapter 9Some Advanced Programming Techniques219
Command-Line Arguments219
Example 9.1Display File from Command Line221
Function Overloading224
Example 9.2Printing Different Types of Arrays226
The do-while Loop228
The switch-case Statement230
Multiple Modules231
Exception Handling234
Example 9.3Exception Handling with GCF239
Chapter 9 Summary242
Chapter 10Getting Yourself Object Oriented245
Why Get Object Oriented?245
A String Parser247
Objects vs. Classes248
Another Example: The Fraction Class249
Object Creation and Destruction250
Inheritance, or Subclassing251
Creating Shared Interfaces252
Polymorphism: True Object Independence253
Polymorphism and Virtual Functions255
What about Reusability?257
Chapter 10 Summary259
Chapter 11The Fraction Class261
Point: A Simple Class261
Private: Members Only (Protecting the Data)263
Example 11.1Testing the Point Class266
Introducing the Fraction Class268
Inline Functions271
Find the Greatest Common Factor273
Find the Lowest Common Multiple275
Example 11.2Fraction Support Functions276
Example 11.3Testing the Fraction Class280
Example 11.4Fraction Arithmetic: add and mult283
Chapter 11 Summary288
Chapter 12Constructors: If You Build It...291
Introducing Constructors291
Multiple Constructors (Overloading)293
The Default Constructor...and a Warning294
Example 12.1Point Class Constructors296
Example 12.2Fraction Class Constructors299
Reference Variables and Arguments (&)302
The Copy Constructor304
Example 12.3Fraction Class Copy Constructor306
Chapter 12 Summary310
Chapter 13Operator Functions: Doing It with Class313
Introducing Class Operator Functions313
Operator Functions As Global Functions316
Improve Efficiency with References318
Example 13.1Point Class Operators320
Example 13.2Fraction Class Operators323
Working with Other Types328
The Class Assignment Function (=)329
The Test-for-Equality Function (==)330
A Class "Print" Function332
Example 13.3The Completed Fraction Class333
Chapter 13 Summary339
Chapter 14What's "new": The StringParser Class343
The "new" Operator343
Objects and "new"345
Allocating Array Data347
Example 14.1Dynamic Memory in Action349
Design for a Parser (Lexical Analyzer)350
Example 14.2The StringParser Class355
Chapter 14 Summary361
Chapter 15What's "this": The String Class363
Introducing the String Class363
Introducing Class Destructors364
Example 15.1A Simple String Class366
"Deep" Copying and the Copy Constructor370
The "this" Keyword372
Revisiting the Assignment Operator374
Writing a Concatenation Function375
Example 15.2The Complete String Class377
Chapter 15 Summary382
Chapter 16Inheritance: What a Legacy385
Subclassing for Fun and Profit385
Example 16.1The FloatFraction Class389
Problems with the FloatFraction Class394
Example 16.2The Completed FloatFraction Class398
Example 16.3The ProperFraction Class399
Private and Protected Members404
Example 16.4Contained Members: Fraction Units406
Chapter 16 Summary410
Chapter 17Polymorphism: Object Independence413
A Different Approach to the FloatFraction Class413
Virtual Functions to the Rescue!415
Example 17.1The Revised FloatFraction Class418
"Pure Virtual" and Other Arcane Matters423
Abstract Classes and Interfaces424
Why cout Is Not Truly Polymorphic426
Example 17.2True Polymorphism: The Printable Class427
A Final Word (or Two)431
A Final Final Word432
Chapter 17 Summary433
Appendix AC++ Operators435
Appendix BIntrinsic Data Types439
Appendix CC++ Syntax Summary441
Literal Constants441
Basic Expression Syntax441
Basic Statement Syntax442
Control Structures443
Special Control Statements445
Data Declarations446
Function Declarations447
Class Declarations448
Appendix DASCII Codes451
Appendix ECommon Library Functions453
String Functions453
Data-Conversion Functions454
Single-Character Functions455
Math Functions455
Randomization457
Appendix FGlossary of Terms459
Index469
From the B&N Reads Blog

Customer Reviews