C Programming - Memory Allocation - Discussion
Discussion Forum : Memory Allocation - General Questions (Q.No. 3)
3.
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;
}
Discussion:
25 comments Page 3 of 3.
Murugan said:
1 decade ago
Can you write a simple program of memory allocation?
Renuka said:
1 decade ago
When we can use dealloc().
Ashok said:
1 decade ago
Yes I agree with seema & ram by free() memory is from allocation.
Muruganandam said:
1 decade ago
free() function is used for to free the memory space.
Seema said:
1 decade ago
It is a obvious answere because memory is freed by free() function. Which is option D.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers