The array elements are 5 and the size is 4 then multiplying both we get 20 that is the size of the array and second one is size of the each array element and third one is size of the first array element that is 4 only thats why anwer 20,4,4
Pradeep said:
(Mon, Jul 26, 2010 02:30:13 AM)
Thank you.
N Prathyusha said:
(Tue, Jul 27, 2010 03:13:22 AM)
The array elements are 5 each of size 4 bytes so it is 20.
Where as second is size of addres not the individual element so the size of int as declared is 4 so it is 4.
Then the final one is size of individual element i.e. size of first array element so it is 4.
Pradip Somase said:
(Sat, Aug 21, 2010 07:50:48 PM)
Thank you Pondey Ramu for description.
Srinivas.L said:
(Wed, Sep 1, 2010 02:35:38 AM)
The array elements are 5 each of size of 5 bytes. So it is 20.
Where as the second one is it will prints the address to store the int data type array so its value is 4.
And in last one is also it will prints the address of the arr[0], which is integer data type so its value is 4. So the final answer is 20 4 4.
Viraj said:
(Sat, Nov 20, 2010 10:56:55 AM)
Output will be 10 2 2 on 16 bit compiler.
Narendra said:
(Thu, Jan 20, 2011 11:23:24 PM)
The array elements are 5 each of size of 4 bytes. So it is 20,
where as second one is sizeof(*arr) means i.e pointer .all pointers occupies 4 bytesin 32 bit compiler so it is 4 bytes
and last one is same.
In 16 bit compiler it is 10 2 2;
Nirlep said:
(Sun, Feb 6, 2011 05:51:13 AM)
Why multiply by 4 it should be 2?
K Suresh said:
(Fri, Jul 8, 2011 04:14:41 AM)
THANK YOU PRATHYUSHA
Soumya said:
(Tue, Jul 26, 2011 11:20:01 PM)
Thank you pondey ramu.
Maya said:
(Wed, Aug 10, 2011 04:16:49 PM)
@nirlep:
It is given in the question. that int is of 4 bytes, so multiply by 4 and not 2