ozone,
consider this to understand it better:
int MyVariable;
What is MyVariable and how is it stored in memory of your computer?
well int is 4 Bytes wide. (on some OS-es it is 2 bytes however)
so your int is stored into a 4 Bytes block inside a memory (hipoteticaly)
How do you write some data into that block of memory?
you will type this:
MyVariable = 541;
and how do you read from that block of memory?
you type:
MyVariable;
Now consider this problem:
You need 10 ints not only one:
How will you alocate a block of memory for 10 int's ? (on the stack)
int MyVariable[10];
Now you have a block of 10 * 4 Bytes = 40 Bytes wide block
How do you input some data into that block?
you type:
1 2
|
MyVariable[0] = 4; // write into first int
MyVariable[1] = 445; // write into second int
|
etc....
as you see counting goes from zerro not from 1 :D
And how do you read from that block of memory?
MyVariable[0]; // read first int.
Now by having this super knowelege, you are able to solve your problem on your own! :D