Pointers are suitably named: they "point" to place in memory. Imagine of a row of protection deposit boxes of different sizes at a local bank. Every secured deposit box will have a figure connected with it so that the banker can speedily look it up. These figures are similar to the memory addresses of variables. A pointer in the world of security deposit boxes would just be something that stored the figure of one more safety deposit box. Maybe you have a well-off uncle who stored valuables in his security deposit box, but determined to place the genuine location in one more, smaller, safety deposit box that only stored a card with the number of the huge box with the genuine jewelry. The safety deposit box with the card would be storing the site of one more box; it would be equal to a pointer. In the PC, pointers are presently variables that store memory addresses, typically the addresses of additional variables.

The cool fixation is that once you can converse regarding the address of a variable, you'll then be capable to go to that address as well as recover the data stored in it. If you occur to include a giant part of records that you want to surpass into a function, it's a lot easier to pass its spot to the function than to copy all elements of the data! Also, if you require more memory for your program, you can ask for additional memory from the system--how do you acquire "back" that memory? The system informs you where it is situated in memory; that is to declare, you acquire a memory address back. As well as you require pointers to store the memory address.

A message regarding terms: the word pointer can refer also to a memory address itself, or else to a variable that stores a memory address. Typically, the difference isn't in fact that significant: if you pass a pointer variable into a task, you're passing the value stored in the pointer--the memory address. When I want to converse regarding a memory address, I'll refer to it as a memory address; when I need a variable that stores a memory address, I'll call it a pointer. When a variable stores the address of one more variable, I'll declare that it is "pointing to" that variable.