Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

Which is the most reliable way to find a memory leak in a C++ program?

  1. A Reading the code carefully
  2. B Running under a tool such as Valgrind or AddressSanitizer with leak detection
  3. C Adding print statements
  4. D Increasing the heap size
Answer

Running under a tool such as Valgrind or AddressSanitizer with leak detection

The structural fix is to eliminate the possibility by using RAII and smart pointers rather than raw owning pointers.

All C++ MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as