Before i read into pointer basically what are they? what can i do with them? Thanks
Printable View
Before i read into pointer basically what are they? what can i do with them? Thanks
Pointers are variables that store the memory address of other variables. You can use them to manage dynamically allocated memory, pass object by reference, traverse arrays and do weird optimizations that you can't understand anymore 10 minutes later.
In C++, there are also references that are simplified version of pointers.
References:
Pointers:Code:int e = 3;
int &m = e;
m = 4;
Code:int e = 3;
int* m = &e;
*m = 4;