In the above statement, *pparr dereferences a pointer to an array,
resulting in an array to which array-to-pointer conversion is applied,
resulting in a pointer to the first element of the array.
The expression &arr[0] also results in a pointer to the first element
of the array. Due to value to which pparr was initialized, the output
to cout of the expressions *pparr and &arr[0] are the same. The
output to cout of the expression arr would also be the same, due to an
implicit array-to-pointer conversion.
The expression *parr dereferences a pointer to int, resulting in the
pointed to int. That same int would be output by the statement
std::cout<< "value of (*pparr)[0]\t\t" << (*pparr)[0] <<std::endl;
or
std::cout<< "value of arr[0]\t\t" << arr[0] <<std::endl;
Look at the difference in the output of the two statements:
std::cout<< "value of pparr\t" << pparr <<std::endl;
std::cout<< "value of pparr+1\t" << pparr+1 <<std::endl;
On a system where sizeof int is 4 the difference will be 0xa0
(decimal 160). That is the amount of space occupied by an
array of 40 ints. pparr is a pointer to an array of 40 ints.
The variable parr is a pointer to an int, not a pointer to an array.
The variable pparr is a pointer to an array, not a pointer to a
pointer to an array.
No it outputs the type, not the pointed to object.
*pa1i does not derefernece a pointer to the array, it dereferenes a
pointer
to a tempory object of array-type.
Basically its a fancy pointer to a pointer.
I never said that typeid outputs the pointed to object. The
declaration was
int a1i[4], (*pa1i)[4] = &a1i;
pa1i is a pointer to an array. *pa1i dereferences it resulting in
an array. The only objects here are an array (named a1i) and a
pointer to array (named pa1i). There is no pointer to a temporary
object here.