| help | account  


Accelerated C++: Practical Programming by Example
View Larger Image
Andrew Koenig, Barbara Moo
Addison-Wesley, Paperback, Published August 2000, 336 pages, ISBN 020170353X
List Price: $44.99
Our Price: $34.95
You Save: $10.04 (22% Off)


FREE Shipping on Orders over $40!*
Availability: Out-Of-Stock

Customer Reviews: 6     Average Customer Rating:

Write a Review and tell the world about this title!

People who purchase this book frequently purchase:

Books on similar topics, in best-seller order:Books from the same publisher, in best-seller order:

Why is Accelerated C++ so effective? Because it

  • Starts with the most useful concepts rather than the most primitive ones: You can begin writing programs immediately.
  • Describes real problems and solutions, not just language features: You see not only what each feature is, but also how to use it.
  • Covers the language and standard library together: You can use the library right from the start.
The authors proved this approach in their professional-education course at Stanford University, where students learned how to write substantial programs on their first day in the classroom.

Whether you are eager to get started writing your first C++ programs, or you are already using C++ and seeking deeper understanding, the authors' unique approach and expertise make Accelerated C++ an indispensable addition to your library.


Table of Contents

Preface xi

Chapter 0 Getting started 1
0.1 Comments 1
0.2 #include 2
0.3 The main function 2
0.4 Curly braces 2
0.5 Using the standard library for output 3
0.6 The return statement 3
0.7 A slightly deeper look 4
0.8 Details 5

Chapter 1 Working with strings 9
1.1 Input 9
1.2 Framing a name 11
1.3 Details 14

Chapter 2 Looping and counting 17
2.1 The problem 17
2.2 Overall structure 18
2.3 Writing an unknown number of rows 18
2.4 Writing a row 22
2.5 The complete framing program 27
2.6 Counting 30
2.7 Details 31

Chapter 3 Working with batches of data 35
3.1 Computing student grades 35
3.2 Using medians instead of averages 41
3.3 Details 48

Chapter 4 Organizing programs and data 51
4.1 Organizing computations 51
4.2 Organizing data 61
4.3 Putting it all together 66
4.4 Partitioning the grading program 68
4.5 The revised grading program 70
4.6 Details 71

Chapter 5 Using sequential containers and analyzing strings 75
5.1 Separating students into categories 75
5.2 Iterators 79
5.3 Using iterators instead of indices 82
5.4 Rethinking our data structure for better performance 84
5.5 The list type 85
5.6 Taking strings apart 87
5.7 Testing our split function 90
5.8 Putting strings together 91
5.9 Details 96

Chapter 6 Using library algorithms 101
6.1 Analyzing strings 101
6.2 Comparing grading schemes 110
6.3 Classifying students, revisited 116
6.4 Algorithms, containers, and iterators 120
6.5 Details 121

Chapter 7 Using associative containers 123
7.1 Containers that support efficient look-up 123
7.2 Counting words 124
7.3 Generating a cross-reference table 126
7.4 Generating sentences 129
7.5 A note on performance 136
7.6 Details 137

Chapter 8 Writing generic functions 139
8.1 What is a generic function? 139
8.2 Data-structure independence 143
8.3 Input and output iterators 150
8.4 Using iterators for flexibility 152
8.5 Details 153

Chapter 9 Defining new types 155
9.1 Student_info revisited 155
9.2 Class types 156
9.3 Protection 160
9.4 The Student_info class 163
9.5 Constructors 164
9.6 Using the Student_info class 166
9.7 Details 167

Chapter 10 Managing memory and low-level data structures 169
10.1 Pointers and arrays 169
10.2 String literals revisited 176
10.3 Initializing arrays of character pointers 177
10.4 Arguments to main 179
10.5 Reading and writing files 180
10.6 Three kinds of memory management 182
10.7 Details 185

Chapter 11 Defining abstract data types 187
11.1 The Vec class 187
11.2 Implementing the Vec class 188
11.3 Copy control 195
11.4 Dynamic Vecs 202
11.5 Flexible memory management 203
11.6 Details 209

Chapter 12 Making class objects act like values 211
12.1 A simple string class 212
12.2 Automatic conversions 213
12.3 Str operations 214
12.4 Some conversions are hazardous 221
12.5 Conversion operators 222
12.6 Conversions and memory management 223
12.7 Details 225

Chapter 13 Using inheritance and dynamic binding 227
13.1 Inheritance 227
13.2 Polymorphism and virtual functions 232
13.3 Using inheritance to solve our problem 237
13.4 A simple handle class 243
13.5 Using the handle class 247
13.6 Subtleties 248
13.7 Details 250

Chapter 14 Managing memory (almost) automatically 253
14.1 Handles that copy their objects 254
14.2 Reference-counted handles 259
14.3 Handles that let you decide when to share data 263
14.4 An improvement on controllable handles 264
14.5 Details 268

Chapter 15 Revisiting character pictures 269
15.1 Design 269
15.2 Implementation 278
15.3 Details 288

Chapter 16 Where do we go from here? 291
16.1 Use the abstractions you have 291
16.2 Learn more 293

Appendix A Language details 295
A.1 Declarations 295
A.2 Types 299
A.3 Expressions 305
A.4 Statements 308

Appendix B Library summary 311
B.1 Input-output 311
B.2 Containers and iterators 314
B.3 Algorithms 321

Index 325


Customer Reviews

Customer Reviews: 6     Average Customer Rating:

Jan 11, 2004     Sean from New York
Well done... Well done indeed.
There is a running debate as to weather this book is a book for beginners. The answer is yes and no. If youre an experienced "professional" programmer looking to learn C++ then this book is excellent. If you are new to programming and want to learn your 1st language then this book will be over your head. This is NOT an introduction to programming. Its a solid introduction to C++.

Im a 16 year developer who has worked in COBOL, Visual Basic, Delphi and Java. I ordered this book on the recommendation of a colleague and I started reading it on a Saturday morning. By mid afternoon I had completed the entire book and had a firm grasp on C++. The book is clear, concise and effective. After reading this book, your C++ foundation will be laid and anything else you need can be looked up on a reference basis. Its an excellent way to learn the language and get up to speed quickly.

Mar 27, 2002     memset@friedo.com
One word -- incredible.
This book was recommended by one of the best C++ programmers I know--Silent[] on IRC. I suppose I should have gone with this book the first time, but the page count compared to "Beginning C++: The Complete Language" made me choose Beginning C++ rather than Accelerated C++. The chapters looked similar... the only difference really was Beginning C++ had more useful content--so I thought. I won't write a review for Beginning C++, but I did already write one officially for it earlier. After a severe disappointment... I decided to take his word for it and dish out another few bucks and buy Accelerated C++. It was simply incredible what the two authors managed to pack in so few pages. Right from the very beginning they started writing somewhat sophisticated programs. I've seen some people call it "an ideal introductory book." I beg to differ... it's the best C++ book I have read yet, but it isn't a good introductory book. If you have some basic C++ knowledge THEN this book is IDEAL for you. If you have little/no C++ knowledge then you might want to find a friend to sort of guide you through it... overall, however, this book is BY FAR the best C++ book you can find if you want to learn HOW to APPLY C++ while learning the syntax. BUY THIS BOOK! Better yet.. buy it at The Bookpool!

Sep 30, 2001     Brian (codeapocalypse@msn.com) from Pasadena, California
Great approach, well executed.
Since C++ became popularized I have read quite a few C++ books, including a number of introductory texts. This book, "Accelerated C++" is the first I have read which truly puts beginners on the path to write C++ as C++, not as C with extensions. I can't tell you how many C++ books I've read that will try to teach you C first and then (far into it) really begin to teach you those things that make C++ special.

The pace is good, but take the author's advice and work with the examples as much as possible. A great companion book to this would be Josuttis' book "The Standard Library, a Tutorial and Reference" or "The C++ Programming Language" by Bjarne Stroustrup.

Expect to run into some wordy error messages if you try the examples on MS Visual C++ unaltered. These alterations aren't a big deal (see the authors website). Additionally Borland now has their command line C++ tools available for free download (registration required), which compile the examples (at least all I have tried) without complaint.

A great C++ book.

Sep 3, 2001     
A great C++ book
I have many years of programming experience in many languages, but am new to C++ and OO. This book pushed me to the next level. It is clear and consise. It provides background on the why's that typical C++ books gloss over. I would highly recommend this book to anyone.

May 23, 2001     Andrew Koenig (ark@research.att.com) from Bell Labs
Regarding Visual C++ Compatibility
I noticed that your website has an anonymous review of ``Accelerated C++'' that I think is grossly unfair. The fundamental problem with the review appears in the following sentence:

"However, most of the example problems they present fail to compile in Microsoft Visual Studio C++ version 6.0."

Although this sentence is literally true, it fails to mention several important facts:

1) The reason the examples fail to compile is because of bugs in Visual C++, not errors in the book.

2) The examples can be made to compile with only minor changes. Therefore, it is entirely reasonable to use the book with Visual C++, despite the reviewer's claims to the contrary.

3) The website associated with the book (www.acceleratedcpp.com) not only explains all of the problems, but also includes source code for all of the examples with clearly identified corrections for Visual C++.

4) Although Microsoft's service pack for Visual C++ does take a time to download, you can order it on CD-ROM and pay only a $4.95 shipping charge.

Because the review does not mention these facts, it leaves readers with the wrong impression. Is there any way that you can arrange to insert a statement of some kind to correct the misimpression?

Regards,

Andrew Koenig

Mar 14, 2001     
Nice approach, in theory.
Their approach sounds great, in theory. I have lots of C experience and wanted to learn some C++ without being taught C again which is the promise of this book. In the chapters I studied, they covered a lot of material quickly (e.g., functions from the standard library). Knowing the library functions makes writing real programs possible. So, I was pleased with the approach.

I learn best by studying the examples in the text and modifying them to see the new results. However, most of the example programs they present fail to compile in Microsoft Visual Studio C++ version 6.0. I spent a lot of time checking my typing to make sure I had not made errors. The messages from the compiler are about as obtuse as possible. Then I did some experimentation to try to get around the compile errors. With that having failed,in most cases, I finally I decided to go look at the source on their website for the book. At the website, I found out muc too my surprise that the authors already knew that version 6 of C++ does not work. They give lists of pervasive problems (in all examples for many chapters) some with workarounds but most without. They failed to mention these problems in their forward or any other place in the book. I finally gave up in frustration, on the book and their examples, somewhere in Chapter 4.

If you are using a C++ compiler that actually compiles and runs C++ (not Microsoft Visual Studio version 6.0) then you may find this book useful. Or if you learn simply by reading. If you are attempting to use Microsoft then I would recommend another compiler. There is a fix pak for this product but it is bundled with the remainder of Visual Studio so you cannot get a fix for just Visual C. This fix pak is 133MB and takes a very long time to download even on a fast link because the site is very busy.

The authors claim they tested their code so they had to compile it with some compiler and it could not have been done with Microsoft's! I would try IBM's Visual Age C++ compiler, if I had a copy.



Forgot your password?
FAQs
Shipping Options
Returns
Your Orders
Your Account