+ 1
What's the meaning of *&? And what is it used for?
4 ответов
+ 8
A reference to a pointer?
+ 2
Let's slice "*&x" a little bit: "&x" stands for the address of the variable x, just like @MohamedAhmedRamadan said. Now "*" refers to the content of a memory address. So think it like being "*(&x)": "the content of the address of x"... that is... x itself. Think of & and * being one opposite of the other.
+ 1
* is used to declare a pointer "int *p;", used to get pointer's value "cout << *p;"
& is used to get a variable's address "cout << &x;" prints x's address.
? is used for a conditional statement like "int A = (x > y) ? 5:3;" if x > y then A equals 5 if not A equals 3.
0
No I mean this => *&