Q:

What is a Memory Leak?

0

What is a Memory Leak?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

A memory leak is a common and dangerous problem. It is a type of resource leak. In C language, a memory leak occurs when you allocate a block of memory using the memory management function and forget to release it.

int main ()
{
    char * pBuffer = malloc(sizeof(char) * 20);
    /* Do some work */
    return 0; /*Not freeing the allocated memory*/
}

Note: Once you allocate a memory than allocated memory does not allocate to another program or process until it gets free.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions For Experienced

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Why static functions cannot access non-static vari... >>
<< How to handle the exception in C++?...