How will you free the memory allocated by the following program? #include…

PYQ UGC NET 2023

How will you free the memory allocated by the following program?

#include <stdio.h>
#include <stdlib.h>

#define MAXROW 3
#define MAXCOL 4

int main()
{
    int **p, i, j;
    p = (int **) malloc(MAXROW * sizeof(int*));
    return 0;
}
  1. A.

    memfree(int p);

  2. B.

    dealloc(p);

  3. C.

    malloc(p, 0);

  4. D.

    free(p);

Attempted by 744 students.

Sign up free to check your answer

Sign up free

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…