In C++, if a programmer forgets to deallocate memory using delete, it can result in a _______. 

  • segmentation fault 
  • memory leak 
  • compilation error 
  • type error
A memory leak in C++ occurs when programmers allocate memory (typically using the new operator) but forget to deallocate it (using the delete operator). This causes the program to consume memory resources continuously, which might lead to system slowdowns or crashes.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *