c++ primer

I am learning C++ with C++ Primer book 5th edition. I finished the first 3 chapters. I was just reading. Then by getting to chapter 3 I felt that I was forgetting the stuff I read in the beginning(not general, but specific, for example what is '\a'). Then I started the book from 0 again. Began writing everything down on paper, writing code for each topic to understand better. And guaranteeing understanding by using forums(SO) and researching in internet. For many topics I had to get specific information regarding compilers/OS/Hardware/Memory and etc. With this approach, I really understand almost everything in depth, but it takes very long, like 40 pages for 30 hours(together with research, coding and etc). With this approach it would take me about a year to finish the book. And furthermore, again it is not possible to memorize all important features, for example change of meaning of const pointers const references and const auto-types depending on context. I don't get how can I achieve learning it well. And my struggle is just with understanding C++ itself, without reading books on optimization, OS's, compilers, hardware architecture, and etc. How am I supposed to develop well-designed fast code? It seems that I need to study many years. And I have a job, I can study at most 2-3 hours after work. And I don't want learning basic stuff first. I have already worked with Java(including multi threading, inheritance and etc.) and done basic C/C++ projects while I was in university. Am I supposed to know everything written in the book? If no, then this book would be reference book, not a study book. But it is one of most known study books, and indeed it is an excellent book. How long did it take for you to come to a desired level?
Well, first of all, if you know Java as well as you say you do, you should know C++ quite well. Java and C++ have very similar syntax.

I was fortunate to begin my programming journey with C++. As I learned other languages it became easier to assimilate their intricacies. I would recommend reading a simpler C++ book. The one you're reading is intended much as a reference, not a study book. I mean, it's like 500 pages long.

So ditch that book for now--come back to it later--and start on a basic C++ book. Learn about the syntax and reason for functions, for classes, and for object-oriented programming.

Only then should you come back to the reference book to round out your C++ education with some more advanced topics.


Good luck!
closed account (E0p9LyTq)
rrzayev wrote:
I am learning C++ with C++ Primer book 5th edition.

That book is a good reference, but not for learning the basics of C++ without prior experience. Even Bjarne Stroustrup's "Programming: Principles and Practice Using C++, 2nd Edition" is not a book best suited for learning C++ without help of a mentor or classroom instruction.

There are many online resources for learning the basics of C++, such as the tutorial section here.

http://www.cplusplus.com/doc/
http://www.learncpp.com/

Use multiple sources to learn C++, never use just one book or online website.
https://isocpp.org/wiki/faq/how-to-learn-cpp#buy-several-books
Topic archived. No new replies allowed.