Ur compiler might have supported 4 bytes to store an integer value.... sizeof(arr) Since the array is capable of holding 5 integer values at the most total byes required=4*5=20 byte.
Now, sizeof(&arr) Here you referred the starting address of the array and the addresses are integer values the output is as same as sizeof(int)=4 byte So you get 20 4 as output Hope you got it.... :) On 3 August 2011 01:45, Anuj kumar <[email protected]> wrote: > #include<stdio.h> > #include<conio.h> > int main() > { > int arr[5]; > printf("%d %d\n",sizeof(arr),sizeof(&arr)); > getch(); > return 0; > } > > o/p 20 4 > > anybody can tell me how 20 is coming plzz > > -- > 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. > -- Thavasi -- 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.
