Possible Duplicate:
What are the barriers to understanding pointers and what can be done to overcome them?
Probably the silliest question I'll be asking on here, but a year's worth of random googling about when the thought came onto my mind has gotten me nowhere.
Would someone care to explain to me the use of pointers in C(++), why they are useful, and the practical application of pointers?
What I already know:
- The
&
pointer, when preceding a variable name, changes the reference to refer to the variable's address in memory. - Pointers save space on the stack.
- It's possible to get by without pointers, though libraries such as the standard library require basic knowledge of them, which severely limits what you can do if you choose not to learn them.
For those attempting to explain--if it helps at all--I have 5 years of amateur experience in Java, which--in practice--does not handle pointers the way C does (however, Java does utilize pointers--see the NullPointerException for proof of that).
Thanks in advance!