An array is a group of elements of the Same Type mapped consecutively in memory one-next to the other.
The size of the array is:
sizeof(any element) * the number of elements
So the vice-vers to get the number of elements of an array you can:
Number of elements = sizeof(array) / sizeof(any element).
These elements are addressable and each one is addressed with the first byte's address.
int a[] = {1, 10, 100, 1000, 10000};
std::cout << sizeof(int) << std::endl; // 4
std::cout << sizeof(a) << std::endl; // 20: 5 * 4
The addresses:
cout << &a[0] << " : " << &a[1] << " : " <<
&a[2] << " : " << &a[3] << endl;
The outPut:
0018FF38 : 0018FF3C : 0018FF40 : 0018FF44
As you can see the address is incrementing by sizeof(int) // 4
The result:
0018FF38 : 0018FF3C : 0018FF40 : 0018FF44
As you can see the result is identical.
To move from one element to another just increment / decrement the address as I did above:
tmp++; // incrementing the address by 1 means moving to the next element, element means an integer which means 4 bytes. 1 here is not a single byte but a unit or element which is 4 byte here;
To move to the n-element just:
tmp += n;
In your example:
address = (address + sizeof(int)); :
address = address + 4; // moving to the 0 + 4 element which means fifth element (here outbound).