+ 1
I don't understand about pointers and &
I understand how to use, but not why they exist? Why I need pointers and that stuff to locate an address?
2 Respostas
+ 4
& is a special operator that returns the address of a given variable. The * operator helps retrieve the value stored in the pointer variable. For example,
a = 8;
int *ptr = &a;
Here, the pointer stores the location of the variable a, so that any change in a is reflected in *ptr and vice versa.
+ 2
Pointer in c++ are used in data structures