I'm a little confused about sizeof, pointers and arrays. I'm starting with the information that an array name is really just a pointer to the first element in the array. So far so good.

If I initialize an array like:

Code:
int mins[5] = {4, 6, 2, 7, 9};
then "sizeof mins" gives me 20 - the total size of the array. But how is this so? If 'mins' is really just a pointer to the first element of an array, then shouldn't it give me 4 (assuming a 4-byte address)?

Indeed, if I pass the pointer 'mins' to a function - e.g. 'sum(mins, 5)' - and that function header is:

Code:
int sum(int ar[], int n)
then if I ask for 'sizeof ar' I'm given 4, since 'ar' is a pointer. But isn't 'mins' also a pointer?

General sizeof/array/pointer confusion here! Help!