r/learnprogramming • • 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

12 comments sorted by

4

u/[deleted] 15d ago

Bjarne Stroustrup, "The C++ Programming Language"

1

u/Ok_Lunch_2500 15d ago

Thank you! Might sound like a dumb question, but for someone who has little to no cpp knowledge, how long would you think it would take me to become proficient enough for interviews (quant focus). i have a faang+ internship under my belt, but desperately not trying to go back full time.

2

u/Zen-Ism99 15d ago

Stroustrup’s “Programming Principles and Practice Using C++”

1

u/[deleted] 15d ago

Ah, yes, forgot about this one! I recommend it as well.

1

u/[deleted] 15d ago

Given that you know Python and Java so you don't have to learn everything, but you don't know C, so there is still a lot to learn, and assuming you are doing it on spare time, I'd say 3-4 years if you are serious about it. The problem is not just learning syntax (though C++ is huge compared to C), but all idiomatic constructs, traps, etc. And you'll have to code real projects as well, not just hello world material.

1

u/lisa_j_870 11d ago

I wouldn't use "proficient in C++" as the interview bar. Pick target quant roles, practice their coding format in C++, and track whether you get stuck on algorithms or language/library gaps. A time estimate needs your weekly study hours and starting point.

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..?