C Programming - Memory Allocation - Discussion
Discussion Forum : Memory Allocation - Find Output of Program (Q.No. 6)
6.
Assume integer is 2 bytes wide. What will be the output of the following code?
#include<stdio.h>
#include<stdlib.h>
#define MAXROW 3
#define MAXCOL 4
int main()
{
int (*p)[MAXCOL];
p = (int (*) [MAXCOL])malloc(MAXROW *sizeof(*p));
printf("%d, %d\n", sizeof(p), sizeof(*p));
return 0;
}
Discussion:
24 comments Page 3 of 3.
Hari said:
1 decade ago
"*" indicates address of the pointer
Ritu said:
1 decade ago
What does "*" indicates there?
John said:
1 decade ago
It depends upon the compiler
Divya said:
1 decade ago
thanks
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers