What is the best source to learn C++ for a C programmer.
Maybe Bjarne Stroustrup's Learning Standard C++ as a New Language would be a good start?
I'd recommend the book written by the creator of C++. Especially since you're familiar with C, and the basic syntax is the same. OOP, inheritence, and other advanced topics will be covered very well in this book.
A University.
Seriously. the Best way to learn anything is through frontal lectures. no books or tutorials could possibly replace that.
I wouldnt say Stroustrup's book is the best for beginners, it's rather terse (still worth reading of course, but maybe not as the first on the subject). Try Bruce Eckel's "Thinking in C++", it's free.
Any beginner book, for example "C++ Primer", then a lot of practice and then books like the series "Effective C++" and "Exceptional C++". And the cppreference.com is a great C++ reference.
I made this transition about a year or so ago.
IMO, the most important thing is to do is to get into the OOP way of thinking. So (1), get a text that will teach you what classes are, what the keywords do etc. (2), get a good reference book with the C++ libraries in it. (3) get a book 'about' C++ that will not just teach you syntax etc, but how to program the C++ way.
I personally found C++ The Complete reference to be very good, as it covers needs (1) and (2) above. The first half discusses the basics of C++ (it actually starts with C and then moves on to C++), while the second half is a library reference. (also Stroustrup is good)
For (3), get Effective C++, or something similar to talk about the finer points of the language, and the 'right way' to do things.
Well, I'd advise to self-learner to open wikipedia (great starter!). Next, find or steal good environment (For linux its KDE, for windows - Visual Studio 6 or 2003 or 2005) and build alone your first "Hello, world" program. As a book I'd recommend S. Lippman' C++ Primer
This is how I did it, I really enjoyed it, it was great fun, I even typed in all the assembler in the back, ahh the good old days before the internet!
Advanced Graphics on Vga and Xga Cards Using Borland C++
I then bought all the usual books, no point listing them everyone has already done that.
You should read
C++ FQA lite
The main purpose of this FQA is to convince people of the following:
There is no reason to use C++ for new projects. However, there are existing projects in C++ which might be worth working on. Weighting the positive aspects of such a project against the sad fact that C++ is involved is a matter of personal judgment.
If you end up working with C++, don't try to "fix" it (or "boost" it). You'll just add more layers of complexity. The most productive approach is to accept the problems and try to write simple code which people can easily follow.
If you are an expert in the intricacies of C++, please consider this knowledge a kind of martial art - something a real master never uses.
I think the Deitel and Deitel books have always been a good start as they have clean examples and usually good explanations. I'd say the 5th edition is one of the best. See Here
How much depth do you need?
If you need only a little knowledge of C++ -- just enough to get by -- then pick a lightweight tutorial and breathe a quiet sigh of relief that you need go no further. A lot of "industry standard" C++ programmers take this route. :-)
If you want to learn C++ in depth, you've got a long journey ahead of you. C++ is a multi-paradigm language. If you go straight from C to C++ you'll be overwhelmed by C++'s mass of features. These features only make sense after you understand the paradigms they are designed to support, and C++ is not the place to learn about them.
Here's a suggested program of study:
- Scheme for functional programming. (Scheme is very easy to learn. I highly recommend The Structure and Interpretation of Computer Programs and the PLT Scheme environment.)
- Ruby for OO.
- Haskell for declarative programming and general mind expansion (but only after you've grokked Scheme).
Although now quite old the OReilly book C++ the Core Language is specifically aimed at C programmers and does a wonderful job of introducing the essentials. Its only 1cm thick so you can get through it in an afternoon and then start trying things out...
There are plenty good books to learn C++, but if you come from a C background, you need to get your mind out of there for a while and learn the C++ language idioms related to Object Oriented Programming and Generic Programming.
A good starter is Accelerated C++ or its big brother C++ Primer. Either one will show you the basics; althought, the second one will go deeper in the subject.
The C++ Standard Template Library book by Josuttis will help you to understand the standard libraries, and will give you a very good idea on how things are designed and should be designed in C++.
Once you read those, I will recommend Modern C++ Design by Alexandrescu; the book that revolutionized the way programming is done in C++ for the past decade.
The website cplusplus.com has some beginner friendly forums and articles that could help get you started as well as a pretty decent online reference to the libraries and language as well. In terms of books, the C++ Primer Plus tends to get a lot of favorable reviews.
However, as previous noted the best way to learn the language is somewhat dependent up on what you want to do with it. If you are just looking to learn the language for some hobby programming or game development then a targeted book like Learn C++ BY Making Games might be a better place to start. Additionally, if you already know a language, then you can typically find books like C++ for C Programmers that can be quite useful in learning another language.
Thinking in C++ is one of the best C++ book out there, and it's completely free! Grab the two volumes in the Downloads section. I learned C++ by myself with this book a few years ago and it's a great reference.
I don't think that there are "best" or "worst" sources. You just need to have an idea and start developing it. When you stuck somwhere, you will find best source yourself for that problem.
I asked a similar question, Best C++ Resource, on which CPlusPlus.com got many votes.
I am quite late with this one. But there is a free C++ resource specifically for C programmers. It won't waste your time with basics.
The C++ Annotations
This document offers an introduction to the C++ programming language. It is a guide for C/C++ programming courses, yearly presented by Frank at the University of Groningen. This document is not a complete C/C++ handbook, as much of the C-background of C++ is not covered.
Learn Qt. Trust me on this; I develop all kinds of C++ app for a living. C++ with Qt makes you infinitely more productive. I used to combine so many different libraries (Boost, Intel's, database connectors, etc..) just to achieve the kind of stuff we do (high-performance/real-time computing). At the end, I found that more than 80% of what I need is already included in Qt.
Not to mention, imo, Qt has the best documentation on any framework/library I've worked on, which makes it very easy to just learn everything on your own.
Try it, and see for yourself.
Disclaimer: I'm just a developer--I dont work for Nokia. =p