Return to Home Page
      Blog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     FAQ      Search

Thinking in C++ 2nd Edition by Bruce Eckel

Free Electronic Book
Volume 1 & Volume 2

Thinking in C CDROM | Why do you put your books on the web? | Comments from Readers | The Cover Story | Electronic Translations | Strategy | The Electronic Book | HTML Format | Making a Contribution to the Book | Downloading problems | Unzipping | Mirror Sites | Download the book | Download the source code | Win32 Compilers |

Buy the print version of
Thinking in C++, Volume 1
on Amazon.com

Buy the print version of
Thinking in C++, Volume 2
on Amazon.com

Volume 1 Completed: January 13, 2000
Volume 2 Completed: November, 2003
Click Here to go to Volume 1 & Volume 2 download site

The Annotated C++ Solutions Guide

Subscribe to the free OOP Newsletter from Bruce Eckel

Subscribing to the newsletter provides automatic notification when the book is revised and information about CD Roms and C++ Seminars & workshops


The Thinking in C CD ROM

Back to Contents

Chapter 3 is a fairly intense coverage of the C that's used in C++, but if you're just getting started with all this it may be a little too intense. To remedy this, the printed book contains a CD ROM training course that gently introduces you to the C syntax that you need to understand in order to take on C++ or Java. The CD is called Thinking in C: Foundations for Java & C++. Originally we sold this CD separately, but now it is only available bound into the printed versions of either Thinking in C++, 2nd edition or Thinking in Java, 2nd edition (the cost of the book including the CD is actually cheaper that the former cost of the CD alone). The CD was developed by MindView, Inc. and created by Chuck Allison. Chuck is a long-time member of the C++ Standards Committee, an editor on the C/C++ Users Journal, Author of the book C & C++ Code Capsules, and an experienced programmer and consultant. You can find out more about Chuck at http://www.freshsources.com or email him at cda@freshsources.com.

If you buy a book with a cracked disk, email disc_exchange@prenhall.com and they will tell you how to get it replaced.


Comments from readers

Back to Contents

I'd like to congratulate you on your great book "Thinking in C++" 2/e. I first saw it at my campus library and loaned it thinking it was just another C++ book, what a big mistake, it is a great book. When the loan period was over I got the electronic version from your site and finnally after completly zapping through it, I decided to order it and today I finnally have my own copy!! It was a great idea to make it available in your site! I'm looking forward to read your other books. Keep up the good work. Cristiano Lopes, Signal Processing Laboratory - University of Algarve,Portugal

'Thinking in C++' is the best C++ book I've ever read, especially regarding details and ease of learning!!! Gunnar André Dalsnes, Part time developer / student, Norway

Thanks for writing such a good book with such useful examples. Gideon Anthony, Computer Officer, History of Parliament

Thinking in C++ is a Godsend to an Electronic engineer converting to programming! John Williams, BEng, Electronic Design Engineer

I have been a big fan of programming since I was 10 (I'm now 21) and I would just like to say that I have both your Thinking in Java and C++ on my Palm Pilot. Everytime I'm just hangin' out, I read on through the endless scroll. Thanks. The info is great and I constantly learn new things. Marko Rodriguez, Human Computer Interaction - UCSD and Computer Science - UCSC

I was so delighted when I downloaded Thinking in C++ (yesteday), that today I went out and bought the book. Thank you for helping to clarify many things. Neill Edwards, Core Technical Group, Affiniti Inc.

I have read Volume 1 and Volume 2 of Thinking in C++ and I just wanted to tell you that they are the most comprehensive books that I have ever read on C++. Thank you for your quality material! Paul Wendt, Professional Programmer

I'd like to thank you for providing me with the raw materials to take my skills to the next level. I recently purchased Thinking in C++ vol1 (2nd Edition), and I must say, thus far, I am excited to have such a great learning tool. I work full-time for a Microsoft Certified Solution Provider, developing n-tier enterprise business applications. Being primarily a Visual Basic developer, embarking on this 'journey of discovery' has been both enlightening and disheartening at times. That was, until I discovered your book. The hands-on C seminar by Chuck Allison on the accompanying CD was top-notch! I am now halfway through volume 1, and I'm loving every second of it. I originally set out to learn C++ in order to take advantage of Microsoft's ATL, but now I'm equally excited about using my developing skills to develop applications on other platforms. In my experience, the greatest stumbling block in the way of budding C++ programmers is themselves. That is, we tend to move through material without fully understanding it. The pace of your book is perfect. While I'm itching to get to the 'big stuff' like the STL , inheritance, and templates, I now realize why those topics are at the *end* of the book (or in Volume 2). I just want to relay my thanks to you for making this learning process a joy, rather than a chore. For someone with limited time like myself, that makes all the difference. Fred Vandervelde, Solution Developer, Coyote Software Corporation

I have a whole mountain of books and none of them make sense nor do they explain things properly. I have been dying for a good template and STL book. Then I decided to read your material and I was amazed. What you did was show how to write C++ with templates and STL without bogging down with details. What you did was what I expected of the C++ community, the next generation of C++ authors. As an author I AM IMPRESSED at your writing and explanation skills. You covered topics that nobody has properly covered before. Your approach is one from a person who has actually sat down and went through the material in detail. And then you questioned the sanity of the situation and what would be the problem areas. On my bookshelf, it will definitely be one of the necessary books, right beside Petzold. Christian Gross, consultant/mentor cgross@eusoft.com

I think your book is very, very, VERY good. I have compared it to others in the bookstore, and have found that your book actually teaches me basic C++ fundamentals while I learn the STL... a very nice experience to learn about both at once, hand-in-hand. I think your book is laid out very well, and explains things in an easy-to-understand fashion. Jeff Meininger, Software Developer, boxybutgood.com

Your book is really great, and I can't thank you enough for making it available for free on the web. It's one of the most thorough and useful references for C++ I've seen. Russell Davis

Your book is the best by far of any I've seen. Please get it right so that we can all have an excellent and "reliable" reference work! And please hurry! We are desperate for a work of this quality! Steve Strickland, Live Minds (a Puzzle business)

(On Usenet) Unlike most other C++ authors, Eckel has made a career of teaching C++ and Java classes ONLY.  He's had the benefit of a GREAT deal of novice feedback, and the books reflect that.His books are not just about writing in C++/Java, but understanding the intent of the languages and the mindset that goes with thinking in them. Eckel's also the best technical writer I've read since Jeff Duntemann. Very clear and easy to read.  Don't be put off by the apparent large size of his books.  Either can be read in *less* than 21 days.  :-} Randy Crawford, MRJ Technology Solutions, Fairfax VA

When I first started learning C++, your book "Thinking in C++" was my shining guide light in a dark tunnel.  It has been my endeavor to improve my C++ skills whenever possible, and to that affect, "Thinking in C++" has given me the strong foundation for my continuous improvement. Peter Tran, Senior Systems Analyst (IM), Compaq Computer Corporation

On our project at HRB Systems we call your book "The Answer Book".  It is our C++ Bible for the project.  Curt Snyder, HRB Systems

I am greatly in your debt. Your books are a God send. Please don't allow anything to change the way you put the books together. They explain the topics in the way that I can put the whole picture together. You are an expert who wants to help others understand what you know. This is the reason for the demand for your products. Continue on with your way of doing things. Buying your books saves alot of trees because they eliminate the need for any others. Thanks a million. Clyde R. Grace

I would like to thank you for your book 'Thinking in C++' which is, with no doubt,  the best book I ever read about this subject. Riccardo Tarli - SW Engineer - R&D TXT Ingegneria Informatica - Italy

I have been reading both of your books, Thinking In Java and Thinking In C++. Each of these books is easily the best in its category. Ratnakarprasad H.Tiwari, Mumbai, India

I just wanted to thank you for all the work you are doing and sharing with aspiring programmers like myself. I just finished an Intro to C at school and have purchased your Thinking In C++ to prepare me for my intro to C++ during the Fall semester. I am just finishing chapter two, and feel very confident that your book will leave me extremely well prepared to excel in this course. Your writing style is very approachable and meticulous. I find that questions that might arise are usually answered by simply reading on. Thank you very much, and I look forward to reading your other works as I enter new areas of study! James A. Hamilton, Jr., Computer and Information Science Student, University of Maryland


Strategy

Back to Contents

Because of the success of posting Thinking in Java on this Web site, I decided to do the same thing with the second edition of Thinking in C++. For me, it was an invaluable process because of all the comments, corrections and contributions I got for the book. For the readers, it was valuable because they got information early, and because they could print out the book and use it as they needed it (people told me stories about carrying a chapter a time on the train, or the convenience of having the whole book on their notebook computer rather than lugging it around). It could also reach into countries where the exchange rate made it prohibitive to buy books (and so they otherwise wouldn't have been able to buy it). And in the end, it didn't seem to hurt sales, but rather help them, since most people wanted a hardcopy version and didn't want to print or carry the pages unbound.


The Electronic Book

Back to Contents

The electronic version of the book will continue to be free, even after it's published. You have permission to print a copy of the book for your own use.

If you like the book, please:

  1. Recommend it to your friends, mention the URL on newsgroups, and submit it to your favorite search engine. This helps a lot, thanks!


  2. Create links to http://www.BruceEckel.com from your web page, or mirror this page (see the mirror page).


  3. Report any errors or problems you find (using only the form shown later on this page)


  4. Consider buying a copy - it's probably cheaper than the toner cartridge you'll use up, and more convenient to use as well. However, if it works well enough for you as an electronic document, great! The book will continue to be freely available on this web site even after it is printed.



Contributions

Back to Contents

If you've seen Thinking in Java, you know that many people have made small and large contributions to the book, and I do my best to footnote all significant contributions. If you think you've written a piece of code and/or prose that would fit well within the book and you would like to see it published, feel free to submit it. I can't make any promises and if I do use it I'll probably have to do some rewriting, but I'll make a footnote that you contributed it if it is used.

I find good, simple exercises particularly difficult to compose, and am especially grateful for those.


Downloading Problems

Back to Contents

Sometimes I get messages saying people are having trouble downloading the book. This is invariably because of network problems, and eventually I hear back that they've been able to download it. Especially if you're downloading it from overseas, try connecting when everyone's asleep in your country; that often works. In addition, there may be a mirror site close to you.


Unzipping

Back to Contents

To unzip "zip" files, the best place to go for tools is http://www.cdrom.com/pub/infozip/. This is a freeware, open-source implementation of zipping and unzipping programs that work on virtually all platforms. It's also what I use to zip the files.


Mirror sites

Back to Contents

Please consider mirroring this site, since as the book gets more popular the MindView server gets slower. You can find the existing mirror sites here. If you want to mirror the books, go here.


Thinking in C++ File Download

Back to Contents

This section will take you to the book in HTML format.

Remember to right-click the mouse (or the equivalent) and select "save file" when downloading from these links.

The following link will take you to the directory showing mirror sites; you will see appropriately-named files at each site. The source code is already extracted for you, and can be found in the appropriate subdirectory (for Unix/Linux, remember to use the -a flag when unzipping to correct the files).

Go to the Thinking in C++ 2nd edition download site


Source code for Thinking in C++, 2nd ed.

Back to Contents

The source code is included as part of the download for Volume 1 and Volume 2 of the books, respectively.

The source code for the first edition of the book can be downloaded here.

When you unzip the file, you'll get a full directory tree of code and makefiles for that volume of the book. Type make from the root of this tree to, first, discover if you have a make utility properly installed, and second, to discover what your options are. The master makefile can drive makes for more than one type of compiler and operating system, and this is controlled on the make command-line.

If you do not have a make, see here.

When you unzip the program for Unix/Linux, I recommend that you get the zip program from http://www.cdrom.com/pub/infozip/ (which is automatically installed with RedHat Linux and probably others; it is on the book's CDROM in the Info-Zip subdirectory) and use the -a flag when unzipping. This flag automatically corrects the carriage-return/linefeed differences between dos and unix.

Note that the code has only been compiled and tested under 32-bit Windows and Linux (with the latest gcc compiler). Although some code may compile under 16-bit DOS compilers, no support is provided for those compilers, since most of them will be old and won't contain more modern features in ISO C++.

For example, if you want to compile everything for the gcc compiler, in the code root directory you say:

make gcc

This will descend into each subdirectory and invoke the makefile there. You can also call the makefile directly from within any subdirectory like this:

make -f gcc.makefile

to use the version of the makefile for the gcc compiler.

Your compiler may not sucessfully compile all the code in a particular directory (this simply means your compiler doesn't support a particular ISO C++ feature that is demonstrated in the programs that won't compile). To tell make to continue even if a file fails to compile, use the -i flag (which means "ignore errors").


Win32 Compilers

Back to Contents

The code in these books has been written to compile under a fully- compliant ISO C++ (Standard C++) compiler. A command-line version of the Borland C++ compiler is available as a free download. This compiler isn't fully compliant with all standard C++ features; you can find the files that it won't compile (which are excluded from the makefiles) in the file CompilerData.txt which comes with the distributions. While old Visual C++ is not so good, the new Microsoft C++ for .NET (payware) is very good. The free Digital Mars compiler is also very good.

The open-source GCC compiler (g++) is one of the most compliant C++ compilers available. This compiles and runs very well under Linux, but you can also run it under Win32 using Cygwin at http://www.cygwin.com/, which is gcc + the bash shell and gnu utilities ported to Windows. If you've ever used Unix, Cygwin will give you back what you missed -- it's truly remarkable. You can actually compile and run virtually any non-gui Unix application under Cygwin. If you use make, it solves all the problems of trying to use make under Win32.

To learn more about installing Cygwin and GCC on your Win32 machine, see here.

A note about pre-.NET Visual C++. I periodically receive messages saying that Visual C++ will not compile many of the programs in the book. Let me attempt to be diplomatic here. Before .NET, Microsoft stated that what they are creating is "a Windows compiler." Their interest was in creating a compiler that makes Windows programs, and not one that is compliant to the C++ Standard. As a result, the Standard C++ features in pre-.NET VC++ increased at a relative crawl, and you should not expect that compiler to compile many of the programs in the book. The complete listing of files that will not compile can be found in the file CompilerData.txt in both volumes.

If you find a problem with a program and pre-.NET VC++, it is extremely likely that it is a deficiency in VC++ and not in the code listing. A Microsoft makefile is included that will successfully compile all possible programs in the book.

So the upshot is this: if you want to use Microsoft C++, choose Managed C++ for .NET.

Here is a file msfix.h which was created by Chuck Allison to fix the return from main warning and the for loop namespace scope issues in the Visual C++ compiler. [ Click here to download ]


Search     Home     WebLog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     Contact     Site Design     Server Maintenance     Powered by Zope
©2007 MindView, Inc.