Search:
Forum
Beginners
explanation
explanation
Jun 17, 2020 at 2:04am UTC
John3682
(85)
guys can someone explain to me whats this and what does it do ?
int x=10;
int *pointer = &x;
cout << &*&*pPointer << endl; <=== ??????????????
i know what this {&pointer} and {*pointer} means , just have no idea what {&*&*} means
it couts == CCCCCCCC
ty in ad
Jun 17, 2020 at 2:31am UTC
helios
(17607)
Since (*x) means "get the value at address x" and (&x) means "get the address of value x", (&*x) is equivalent to (x). Therefore (&*&*x) is equivalent to (x). Therefore the statement simply prints the value of pPointer:
1
2
cout << &*&*pPointer << endl; cout << pPointer << endl;
Jun 17, 2020 at 3:17am UTC
John3682
(85)
ty for helping ; )
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs