1. ## Quicky Question

When you create an array, such as int m[10], m is actually a pointer, yes yes?

And because pointer arithemetic allows you to add pointers of the same data type, you can add to *m with *(m+1) to skip over one "slot", which is equal to the sizeof(int), right?

The whole m[1] thing is just a cleaner and more understandable way of doing it, yes?

2. Originally Posted by Krak
When you create an array, such as int m[10], m is actually a pointer, yes yes?
m is an array of 11 ints. However, the name m can be used as a pointer to the first element of the array.

And because pointer arithemetic allows you to add pointers of the same data type, you can add to *m with *(m+1) to skip over one "slot", which is equal to the sizeof(int), right?
You aren't allowed to add pointers. I assume you meant adding values to pointers. Yes, *(m+1) accesses location [m + sizeof(int)].

The whole m[1] thing is just a cleaner and more understandable way of doing it, yes?
Depends what you're doing and your personal preference. Many people find a pointers/iterators approach easy to use - look at the STL for example.

3. >When you create an array, such as int m[10], m is actually a pointer, yes yes?<

Well, no actually, however m acts as a const reference to the first value in the array.

>And because pointer arithemetic allows you to add pointers of the same data type, you can add to *m with *(m+1) to skip over one "slot", which is equal to the sizeof(int), right?<

yes, you can use pointer arithmatic to walk through an array. However you cannot change the value of m.

4. You aren't allowed to add pointers
umm. Well you can add pointers, you cannot change the value of m because it acts as a const pointer. Adding pointers however is very possible:

Code:
```#include <iostream>

using std::cout;
using std::endl;
using std::cin;

int main() {

int myArray[4] = {3, 5, 7, 9};
int* myPointer;

myPointer = myArray;

for(int i = 0; i < 4; i++, myPointer++) {
cout << *myPointer << endl;
}

cin.get();
return 0;
}```
-Andy

5. That's not adding pointers. That's adding integral values to pointers - a completely different thing.

6. My bad - misunderstood what you meant.

7. > m is an array of 11 ints.

No, it's 10 ints.

> however m acts as a const reference to the first value in the array
Actually, it acts as an immutable pointer to the (mutable, unless said to be const) first element of the array.

8. Oops - been using VB arrays