r/learnprogramming • u/Ok_Lunch_2500 • 15d ago
Resource Best C++ book/resource?
I am a fourth year computer science major looking to learn c++. I took a c course a while ago but ive forgetten nearly everything. I am most proficient in python and java.
For someone looking to learn c++ today, what is the best book or resource to use?
Thank you for the help!
23
Upvotes
4
u/[deleted] 15d ago
Bjarne Stroustrup, "The C++ Programming Language"
3
u/Abe_Bazouie 15d ago
Since you already know Python and Java, I probably wouldn’t start with The C++ Programming Language. Great book, but it’s a lot.
I’d do this instead:
LearnCpp.com for actually learning modern C++ step by step.
Then A Tour of C++ by Bjarne Stroustrup once you want a faster overview of how modern C++ fits together.
And keep cppreference open basically forever. :)
The big thing I’d avoid is learning C++ as “Java with pointers.”
Spend real time on value semantics, references, RAII, ownership, move semantics, smart pointers, containers, iterators, and the standard library.
Also write actual programs while learning. C++ makes a lot more sense once you’ve had the compiler yell at you for 20 minutes because you accidentally copied something you thought you moved.
2
u/EszterSantos72 15d ago
If you want a book, "Programming: Principles and Practice Using C++" by Stroustrup covers modern C++ (C++11 and up) and is aimed at people who already know another language. It's big but actually teaches idiomatic usage, not just syntax.
2
u/jakingo 15d ago
Start with modern C++ basics, then focus on pointers, memory management and STL. Practise with small projects as you learn.
2
u/YetMoreSpaceDust 14d ago
I know there are people who think otherwise but... I'd recommend really learning and understanding C (without the ++) first and then moving on to C++. Start with K&R (Kernighan and Ritchie's "C the programming language") and understand all of that and then move on to a C++ book (Strostrup's, recommended by others, is fine).
2
u/serialized-kirin 14d ago
i believe there is a website that is literally just directly called "learncpp.com" or something that's supposed to be rly good from what I've heard..?