+ 3

What does a pointer do exactly ?

some pointer pls

11th Aug 2018, 3:17 AM
Aaron
Aaron - avatar
3 Réponses
+ 10
A pointer is a special variable which stores an address of a memory location that contains a certain datatype. Therefore, using pointers you can access the variable directly in memory when you manipulate your data (through an operation called "dereferencing"). This allows us to pass arguments by reference instead of by value, so you can modify your data through functions you define.
11th Aug 2018, 3:22 AM
Eduardo Petry
Eduardo Petry - avatar
+ 1
Simple code explaining pointers: https://code.sololearn.com/c0P4j6Se4qEJ/#cpp Questions? Ask me by email at terrestrial.primate@gmail.com
11th Aug 2018, 10:17 PM
Louie
Louie  - avatar
0
A pointer is a variable which stores the address of another variable.It can store the address of variable only if the datatype of the variable whose address is to be stored is same as that of the datatype of pointer. e.g. int x=2; //x is a int var int *y; //y is a pointer of datatype int. so it can store the addr. of x. To store the addresse, y=&x; now y points to variable x by storing its address.
12th Aug 2018, 6:30 AM
Mahendra Mahajan
Mahendra Mahajan - avatar