Reputation: 1854
Suppose I have
char *t = "XX";
I am wondering what is the type of &t. Is it char or array?
Upvotes: 0
Views: 102
Reputation: 755289
The type of &t
for any expression is a pointer to the type of t
. In this case the type of t
is char*
hence the the type of &t
is char**
Upvotes: 4
Reputation: 5428
You need to know what a pointer is and who does it works.
TYPE * VAR = VALUE;
Here you have:
TYPE
: the type of data that you are storing*
: means it is a pointer of TYPEVAR
: is the variable that store a pointer of TYPEVALUE
: value of TYPEAnd &VAR
is a pointer to VAR
. In your case VAR
is a pointer also, so &VAR
is a pointer to a pointer.
Upvotes: 1