I’m quite new to C++ but have some basic C knowledge. In my past C (university) projects, I used Valgrind to check for memleaks.
Now, with C++, is Valgrind a valid tool? Does C++ suffer the same problems concerning memleaks like C? Or are there even better tools to use in conjunction with C++?
I never use
newanddelete(or other forms of manual memory management) and I very rarely even use pointers. And I still have to wrestle withmemory leaksinvalid memory accesses.1 Valgrind is an indispensable tool for me. Even more important thangdb.1 As Viktor pointed out in a comment, producing memory leaks without manual memory management would be pretty weird (discounting circular references and other special cases).