+ 6
can any one explain the use of pointers in a simple way?
3 Réponses
+ 6
There some causes:
1. Dynamic memory allocation(It's fast access to any object)
2. You can pass object by address to function
3. Fast access to arrays, lists and other data structures.
+ 3
You can think of pointers as arrows that are "pointing" to a value stored in the memory (the value can be a variable, and object, some item store in an array, or anything stored in memory... even garbage...)... the pointer's value is the memory address where is pointing... if you know the memory address where something if stored then you can access it with a pointer... view it, change it, or even crash your computer ;-)
- 1
pointer is simply "integer" type of variables which stores address of another variable..that's it