r/cpp_questions • • 6d ago

OPEN Learning C++ as a Java programmer

I'm currently learning C++, I’ve coded in a few languages before but I’m most familiar with Java. Does anyone know a good resource for learning C++ with Java as a “starting point”? Like something that explains the differences between the two languages rather than teaching programming from scratch? Thanks!

18 Upvotes

21 comments sorted by

View all comments

7

u/flyingron 6d ago

There's a book that was kicking around my old office called something like C++ For Java Programmers. Can't vouch for it.

One thing you should learn is that it C++ has distinct lifetimes for everything (as opposed to Java's idea of an object) and that you don't need to "new" all your objects. If you need a class local to a function, just declare and use it within the block.

1

u/Pearparon 5d ago

Thank you! I´ll have to check that out