• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Best books to learn C++

Joined
5/22/12
Messages
19
Points
13
As the title says I'm looking for the best books to learn C++.

My programming background is MIT Introduction to Programming and Computer science level (Pyhton) http://ocw.mit.edu/courses/electric...computer-science-and-programming-spring-2011/ and some programming and statistical analysis in R

Can you recommend any book to move into C++?

I was looking for one with exercises at the end of each section so it is easier to understand which exercises I should do after each block of concepts.

I read in one of the posts in this forum that Accelerated C++ could be a good choice for someone without a background in C but one of the reviews said that the exercises often require concepts that have not been explained in previous chapters.
 
Hey David Novo
This is from our reading list. I used Savitch book years ago (first edition) and recommend it for people who want a book with lot of examples, exercises.

C++ (ordered by level of difficulty)
 
Hey David Novo
This is from our reading list. I used Savitch book years ago (first edition) and recommend it for people who want a book with lot of examples, exercises.

C++ (ordered by level of difficulty)
David Novo
I can definitely recommend C++ Primer Plus (4th Edition) - it's a thick book and it takes you from some of the very basic stuff to the more advanced stuff. I use it quite a lot (but I don't do the exercises, so I don't know about that).

I have read Problem Solving with C++ but it got boring after short time - it's quite easy but also a nice introduction.
 
As the title says I'm looking for the best books to learn C++.

I read in one of the posts in this forum that Accelerated C++ could be a good choice for someone without a background in C but one of the reviews said that the exercises often require concepts that have not been explained in previous chapters.

Definitely "Accelerated C++" for C++98/03. The part about the exercises is not quite true, there are exercises that are easier to solve if you know the concepts in the following chapters, but you're actually supposed to solve them *only* using what you've read so far (it's a motivation/background understanding thing).

I wouldn't recommend "C++ Primer Plus" by Stephen Prata, it builds too much on C and introduces STL too late. Here's what I mean by the example of the 5th edition:
C++ Primer Plus, Fifth Edition by Stephen Prata
CHAPTER 4: Compound Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
Introducing Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
Pointers and the Free Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144
. . .
CHAPTER 16: The string Class and the Standard Template Library . . . . . . . . .857
The STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .877
The vector Template Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .878
^--- a perfect example of how NOT to learn/teach C++.
There's already 6th edition out, supposedly revised to be up to date with C++11, but, frankly, I wouldn't put too much faith into its quality given the above.

In contrast:
C++ Primer, Fourth Edition by Stanley B. Lippman, Josée Lajoie, Barbara E. Moo
Section 3.3 Library vector Type ... 90
Section 4.1 Arrays ... 110
Section 4.2 Introducing Pointers ... 114

I can strongly recommend "C++ Primer" by Stanley B. Lippman, Josée Lajoie and Barbara E. Moo -- especially since, looking at the Andrew's assessment, the 5th edition (out soon) including C++11 has been written (revised) in a way that is just right (and illustrates how it should be done): http://www.drdobbs.com/cpp/c-primer-5th-edition-part-1-how-to-revis/240003977
See also: http://www.drdobbs.com/author/6821
(This also implies that it's pointless to buy the 4th ed. now).

Note, that Barbara Moo is a co-author of both "Accelerated C++" and "C++ Primer" :)

BTW, coming out next:
C++ Programming Language (4th Edition) by Bjarne Stroustrup (Jan 21, 2013)
http://www.amazon.com/Programming-Language-4th-Bjarne-Stroustrup/dp/0321563840/
:)
 
Isn't "C++ Primer" by Stanley B. Lippman, Josée Lajoie and Barbara E. Moo, hard for a beginner? I was considering one of the Savitch's books. Which of the 3 is better for a beginner in C++ but with some knowledge of the basic programming concepts in a different language?
 
David, depends on the level of the beginner, I'd say the "with some knowledge of the basic programming concepts in a different language" part (plus motivation) normally suffices for the "Accelerated C++". I'm unfamiliar with the Savitch's book.

I definitely think that "C++ Primer" is also better for a beginner than "C++ Primer Plus" -- mucking around with pointers and C-style arrays and having to go through 800+ pages to meet one of the most useful (and used) containers is definitely not the way to go for anyone, esp. someone who just began with C++.

As for whether "Accelerated C++" ("A") or "C++ Primer" ("P") -- they have been written using similar approach to C++ (useful parts first; recall the non-empty intersection of the co-authors sets ;]) so it used to be a matter of taste -- the "A" being more concise and moving at a faster pace, while "P" discussing in more detail (at the cost of more pages to read, naturally ;]). Right now, "P" has been revised for C++11, which is also a factor.
 
I'd say start with one of the Savitch books - it will help build a good foundation. After that, move onto to the Joshi or Duffy book.

It's good that you have some experience with Python but going from Python -> C++ isn't quite the same as C++ -> Python. Python is forgiving, C++ is not.
 
Savitch's book is what I used with no prior programming background years ago and one I continue to recommend to those who wants some hand holding, easy example and exercises before move to more advanced books.
But really, you shouldn't limit to one books. Get a few from our master reading list. You will find you like the style of one author better than others.
That's how you build up your own preference/style for coding.
 
Hi guys, I'm quite new on the forum and I was wondering if you could help me with this. I am currently in my second year of a BSc in Mathematics/Finance and I just completed an object-oriented programming course in Java using Eclipse as a development tool. Considering the above reading list and the fact that I have some knowledge of Java, which book would you recommend to learn c++, and would you also have an IDE to recommend ?

Any help would be appreciated.
Thank you!
 
Hi guys, I'm quite new on the forum and I was wondering if you could help me with this. I am currently in my second year of a BSc in Mathematics/Finance and I just completed an object-oriented programming course in Java using Eclipse as a development tool. Considering the above reading list and the fact that I have some knowledge of Java, which book would you recommend to learn c++, and would you also have an IDE to recommend ?

Any help would be appreciated.
Thank you!

After C++11 the book situation has clarified considerably -- pretty much just two "starters" books to choose from (plenty to read afterward, but either one of the two for starters, depending on your background).

Since C++11 is the way to go when learning C++ -- http://isocpp.org/wiki/faq/cpp11#cpp11-learn -- your choices are easier now.

So, here goes:

- No prior programming background:
http://www.stroustrup.com/programming.html
PPP2 ("Programming -- Principles and Practice Using C++", 2nd Edition) by Bjarne Stroustrup
* Nice, since it's also written well with a careful pedagogical style focusing on the aspects that are not obvious to those completely new to programming.

- Prior programming background (doesn't really matter whether functional/imperative/OO, IMHO):
C++ Primer, 5th Edition by Stanley B. Lippman, Josée Lajoie, and Barbara E. Moo
* Thorough and informative, while readable and approachable, focusing on presenting the most important (from the productivity / usefulness POV) things first, while not being sloppy nor forgetting to warn about things that will bite you in practice (most other C++ textbooks "for beginners" fail miserably here, IMHO only making the entire experience harder).

For more choices -- and the follow-up books worth reading afterward (there's plenty, BTW) -- see:
http://isocpp.org/get-started
http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

//BTW, During your studies, and when actually working with C++, cppreference.com is also going to be your friend.
// There's that other C++ on-line reference site... I'd forget about it :)

(In case this isn't obvious, in 2014 I would definitely recommend against learning C++98/03 -- by implication, don't waste your time with the books focusing on this, it's not worth it -- let alone C, first, especially since you're already familiar with a compiled language. And even if you weren't I probably wouldn't start with C, either.).

As for the IDE -- if on Windows I'd at least familiarize myself with Visual Studio (if you're student, you can get Professional edition for free from Microsoft Dreamspark; if not, Express edition is always free and quite suitable for learning). One may like it or dislike it, but it's pretty much the standard in the Windows development.

If on Linux, then QtCreator, since it's gaining considerable momentum (also becoming popular in the gamedev community), is actively developed, and at least tries to be user friendly.

I used to recommend Xcode for Mac OS X (for the reasons somewhat similar to Visual Studio on Windows), but it's sufficiently... different that nowadays I'd also consider QtCreator there.

Oh, and if you really don't want to use MSVS for some reason, but want an IDE that works on Windows, I'd probably go with QtCreator, too ;-) The cross-platform & CMake support just might come in handy, after all ;-)

On a side note, since you've been using Java, JetBrains (the makers of IntelliJ IDEA, among others), are also working on their own C++ IDE, which may be a serious contender in the future: http://www.jetbrains.com/objc/features/cpp.html
In addition to this, they're also working on ReSharper C++, a productivity plugin for MSVS: http://www.jetbrains.com/resharper/features/cpp.html
May be worth taking a look from time to time...
 
Thanks a lot Polter, you totally answered my question and I appreciate it ! I think I will start with "C++ Primer, 5th Edition by Stanley B. Lippman, Josée Lajoie, and Barbara E. Moo" and then refer to further books when need be.
 
Hey David Novo
This is from our reading list. I used Savitch book years ago (first edition) and recommend it for people who want a book with lot of examples, exercises.

C++ (ordered by level of difficulty)
@Andy Nguyen Sir I am a Mechanical Engineer and I would be learning it from basics. Which book would be the best to buy to learn it from the basics to the level which is required to perform as a Quant in the firms?
 
And also one more thing I wanted to know... What type of Quant is included in MFE curriculum so that I can prepare myself in the quant area well in hand before admitting for the course
 
And also one more thing I wanted to know... What type of Quant is included in MFE curriculum so that I can prepare myself in the quant area well in hand before admitting for the course
This is not the appropriate thread to ask these questions. But since you asked here is my answer:
Quantitative/Computational Finance, Applied Mathematics, Financial Engineering, Mathematics of Finance etc, are similar programs and they prepare you for Quant jobs. Now, the better the program the better the knowledge you will get, but in most of the cases, once you complete successfully any of the programs above, ideally you will be ready to deal in any position of a financial firm/bank.
While you study, you can choose elective courses to specialise in some more specific fields, like risk management, or real estate etc. That depends on you once you are there. If you want to prepare, my advise is to start with more generic stuff, like learning programming languages and be competitive in math courses, whatever the prerequisites are.
For further questions dig in the forum :)
 
This is not the appropriate thread to ask these questions. But since you asked here is my answer:
Quantitative/Computational Finance, Applied Mathematics, Financial Engineering, Mathematics of Finance etc, are similar programs and they prepare you for Quant jobs. Now, the better the program the better the knowledge you will get, but in most of the cases, once you complete successfully any of the programs above, ideally you will be ready to deal in any position of a financial firm/bank.
While you study, you can choose elective courses to specialise in some more specific fields, like risk management, or real estate etc. That depends on you once you are there. If you want to prepare, my advise is to start with more generic stuff, like learning programming languages and be competitive in math courses, whatever the prerequisites are.
For further questions dig in the forum :)
@Pavlos Sakoglou Sir yes thats what I want to know which competetiv math ares should I start in? Can you please send me the link because I am not able to find it related to Math are sir. Thank You in Advance and Sorry for the trouble Sir. Please bear this newbie.
 
@Rahul Jaikar
Didn't you have a engineering degree?
If you have that i suppose that you also are familiar with Calculus.

If you're not. You should start here. - Otherwise i would start to look on linear algebra.
 
@Rahul Jaikar
Didn't you have a engineering degree?
If you have that i suppose that you also are familiar with Calculus.

If you're not. You should start here. - Otherwise i would start to look on linear algebra.
Yes I am familiar with calculus. Math is not I am much qworried about. But for programming I need to start from scratch :)
 
Back
Top