C Programming - Memory Allocation - Discussion
|
|
|
|
Read more:"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."
- Albert Einstein
|
| 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;
}
|
| [A]. |
memfree(int p); | [B]. |
dealloc(p); | | [C]. |
malloc(p, 0); | [D]. |
free(p); |
Answer: Option C
Explanation:
No answer description available for this question.
|
|
Sai Ram said:
(Thu, Sep 16, 2010 05:35:12 AM)
|
|
| |
| Any allocation functions like alloc () , malloc () and calloc () should release their memory space with free () function only. |
|
Seema said:
(Tue, Apr 5, 2011 05:57:38 AM)
|
|
| |
| It is a obvious answere because memory is freed by free() function. Which is option D. |
|
Muruganandam said:
(Mon, Jul 18, 2011 10:43:56 AM)
|
|
| |
| free() function is used for to free the memory space. |
|
Ashok said:
(Sat, Jul 30, 2011 12:16:16 AM)
|
|
| |
| Yes I agree with seema & ram by free() memory is from allocation. |
|
|