+ 1

It's about pointer

How does the pointer store data and how to locate data?

21st Jun 2019, 10:48 PM
Rtys
Rtys - avatar
4 ответов
+ 3
please use the search bar, this question have been asked several times in the past, and nice answers have been given to it
21st Jun 2019, 11:05 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 2
Pointer stores the location in memory of the data it points to. "Referencing" the data with the * operator lets you get the info it points to. To store the data, you "dereference" it with the & operator. At least I think thats the terminology.
21st Jun 2019, 10:54 PM
Jackson O’Donnell
+ 2
A pointer usually stores the address of another variable.
22nd Jun 2019, 12:27 AM
Sonic
Sonic - avatar
+ 2
Jackson O’Donnell Dereferencing not referencing a pointer is getting its value ;) int x = 5; int* p = &x; //& before variable gets its address std::cout << *p; // dereferencing - cout shows "5"
22nd Jun 2019, 1:03 AM
Jakub Stasiak
Jakub Stasiak - avatar