free() Function

#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
    int *p = (int*) malloc(sizeof(int));
    *p = 20;
    free(p);
    p = NULL;
    cout << p << endl;
    return 0;
}

Comments