I get very much confused when it comes to pointers. I want to know each and every concept about pointers in a simple language. I know pointer is a variable which holds the memory location of another variable. But these are some of the doubts which I get. Please help me out.
- Why pointers were invented( I heard its main use is in dynamic memory allocation but please make me understand this. I am getting confused ).
- What pointers have to do with stack and heap? ( I often read in books they use the word stack and heap ).
- How pointers are implemented ( I want to know how pointers are implemented internally in any programming language. Does it require knowledge of compilers to understand this.
- Why they use the indirection instead of directly using the value of variable itself ?
- What are the ways to master the concept of pointers? How much practice is needed?
I am curious to know about these.
The Beginner’s Guide to Pointers is a very good starting point.