Horje
memory leak in cpp Code Example
c++ memory leak
The embodiment of hell
memory leak in cpp
// Program with memory leak
#include <bits/stdc++.h>
using namespace std;
 
// function with memory leak
void func_to_show_mem_leak()
{
    int* ptr = new int(5);
 
    // body
 
    // return without deallocating ptr
    return;
}
 
// driver code
int main()
{
 
    // Call the function
    // to get the memory leak
    func_to_show_mem_leak();
 
    return 0;
}




Cpp

Related
c++ changing string to double Code Example c++ changing string to double Code Example
automatic legend matlab Code Example automatic legend matlab Code Example
c++ random number Code Example c++ random number Code Example
add variable to legend matlab Code Example add variable to legend matlab Code Example
c++ output Code Example c++ output Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10