0
What is pointers? Please help me understand it and how to use it.
2 Respostas
+ 2
Pointers contain a memory address. You can use * to dereference the pointer and access the value pointed.
int a = 42;
int *p = &a;
cout << p; //prints the address of a
cout << *p; //prints the value of a
0
A pointer is a variable pertaining to a memory address (&) usually a hexadecimal, or it can be used to call what's stored in a variable (*p = &variable). Pointers are often used to create editors for programs but can serve many other purposes.