+1 On Sat, Sep 3, 2011 at 8:57 PM, Ankuj Gupta <[email protected]> wrote:
> p is a pointer to an array of 4 integers. So when you do (int(*) > [col])malloc(row*sizeof(*p)) total of 48 bytes is allocated as > sizeof(*p) is 12 bytes. > > On Sep 3, 4:14 pm, rohit <[email protected]> wrote: > > how many bytes are allocated by following code? > > > > #include<alloc.h> > > #define col 4 > > #define row 3 > > > > int main() > > { > > int(*p)[col]; > > p=(int(*)[col])malloc(row*sizeof(*p)); > > > > return 0; > > > > } > > > > please explain answer? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- U.D.I.T Sent by Nokia OVI (c) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
