Okay, let's go for a simple example. Suppose your computer's memory contains only ten memory locations. Now do the following:
Your variable "x" will be stored somewhere in memory as follows:
Code:
Address: 1 2 3 4 5 6 7 8 9 10
Value: ? ? 50 ? ? ? ? ? ? ?
This means the computer has stored the 50 at memory address 3.
If you now do
This declares a variable of type "pointer to int" whose value is the address of the variable "x". Its value is 3, because that is where "x" is stored in memory.
Now write a new program as follows:
Code:
int array[4] = {0,10,20,30};
Your memory might look like this
Code:
Address: 1 2 3 4 5 6 7 8 9 10
Value: ? ? ? ? ? ? 0 10 20 30
So the following are true:
&array[0] is equal to 7
&array[1] is equal to 8
&array[2] is equal to 9
&array[3] is equal to 10
array is equal to 7, because it is the same thing as &array[0].
And all of these 5 things are pointers that can be passed to functions that expect an "int *" as an argument.