pointers help

Hello
This is a very simple question but i did not figured it out yet
I was asked to do a small program with pointers and during the work i faced with some thing strange i needed to compare the address of pointers while running on array and incriminating one pointer from start and the other from end but i could not get the address in the following way
1
2
3
4
5
6
7
8
9
10
int myArray[] = { 1, 1, 2, 0, 1, 0, 1, 2, 2, 0, 1, 0 }; 
int *FirstVar; int*LastVar;

FirstVar=&myArray[firstIndex];
LastVar= &myArray[lastIndex];

int x =  &FirstVar; 
int y =  &LastVar;
int a = &myArray[firstIndex];  
int b = &myArray[lastIndex];  

i was surprised to see that x dose not equal to a
and y dose not equal to b
can some one pls explain me
Thx
Why would it?

x is the address of the variable 'FirstVar'.

a is the address of the first integer in the array 'myArray'.

Hope this helps.
Ahhh
so how do i get the adress of first int from myArry with a help of pointer FirstVar
Thx
FirstVar is the address of the first int in myArray.
Topic archived. No new replies allowed.