# Thread: I give up on pointers

1. An array is precalculated block of memory that takes up space in the stack. When you are making references to an array you are are using a pointer to that block of memory. i.e. int i[10]; i points to your block of data but is designed only to point to that data whereas a normal pointer can point to arbitrary memory addresses. In other words an array is a pointer, however, it is more restricted (at least it is supposed to be).

Code:
```int i[10];
//i is a pointer to a block of memory which is large enough to hold 10 ints.
//I am trying to carefully word this so that I don't make it sound like I'm saying i is a pointer to an array.```
It is kind of an abstract concept here. But Polymorphic OOP is correct in saying an array isn't a pointer. However in my example shows how a an array is a pointer. I just don't think this subject is debatable.

2. In other words an array is a pointer, however, it is more restricted (at least it is supposed to be).
No, that is not true at all. In your example "i" is NOT a pointer it is an array, and no, AN ARRAY IS NOT A POINTER!!! It's not a pointer to an array, it's not a pointer to a block of memory, it's not even a pointer to the first element. It's an array period!

The fact that when you use the array name it represents a pointer means nothing at all! It's the same logic that goes with the return type of a function. A function that returns a pointer to an int is not itself a pointer to an int! The same goes for an array!

Your example does not show that "i" is a pointer. It only shows that you don't understand what an array is in C++.

3. Back to the original question...

A pointer is a variable that stores an address of another variable.

An analogy: Bob doesn't have the homework answers, but he always knows who does. You go to Bob's address and he points to Betty's address one day, and to Sally's address another day.

I've used a pointer to a class when functions in one class needed to access member functions and member data in another class.

I was looking at an example program that access the computer hardware a couple of weeks ago. I think they used a pointer to force a variable to "reside" at a particular hardware address... or something like that.