First of all, understand that there is a difference between object 1 and the expression that we use to refer to this object. In your code, a is an expression that refers to an object large enough to hold 3 int values.
sizeof it is an operand of sizeof or unary & operators, or is a string literal used to initialize another array in a declaration, an expression of the type "N-element array of T " will be converted ("decay") to an expression of the type "pointer to T ", and the value of the expression will be the address of the first element of the array.
Given a type statement
cout << a;
expression a is of type "3-element int array"; since a not an operand of sizeof or unary & operators, it will be converted to an expression of type "pointer to int ", and the value of the expression will be the address of the first element in the array.
OTOH given type statement
cout << &a;
the expression a is the operand of the unary operator & , therefore, the rule does not apply; instead, the type of the expression is a "pointer to a 3-element int array", and the value of the expression is the address of the array.
In both C and C ++, the address of the array and the address of the first element of the array are the same, therefore both expressions give the same value, but the types of the two expressions are different ( int * vs. int (*)[3] ).
In a statement
cout << sizeof a;
the expression a is the operand of the sizeof operator, so again the conversion rule is not applied; instead, the expression sizeof a calculates the number of bytes used by the array (in this case 12).
In a statement
cout << sizeof &a;
expression &a evaluates the address of the array and is of type int (*)[3] , so sizeof &a evaluates the number of bytes used by the pointer type (in your case, 4 bytes).
In C and C ++, when you declare an array like
int a[3];
the only storage allocated for the three elements of the array; there is no separate storage for the variable a , which points to the first element of the array (which is why a and &a give the same value).
1. In the sense of something that takes up memory, not the meaning of an instance of a class