It seems the compiler does assume 0 is the other dimention is ommited...but this makes sense as all that dimention acts as is an offset....so no offset presented; none applied!
1240040
1241040
1242040
1243040
1244040
1240040
1240050
1240060
1240070
1240080
The standard says that int Array[5][6] is implemented like an array of 5( int Array[6]).......
A good way to look at multidimentional arrays is how you have to implement them in your own containters.....Scott Meyers discribes the use of proxy classes to make this possible......and this is simply applying how the compiler implements arrays itself internally (unfortunately operator[][] doesnt exist for built in types or classes - its all arrays of arrays)
Code:
#include <iostream>
template<class T,int alpha,int beta>
class MyArray{
class MyProxy{
T m_t[beta];//array of data
public:
T& operator[](int i){return m_t[i];}
} m_p[alpha];//array of proxies
public:
MyProxy& operator[](int i){return m_p[i];}
};
int main(void){
const int alpha = 4,
beta = 5;
MyArray<int,alpha,beta> Arr;
for(int i = 0; i < alpha;++i)
for(int j = 0; j < beta;++j)
Arr[i][j] = i + j;
for(int i = 0; i < alpha;++i)
for(int j = 0; j < beta;++j)
std::cout << Arr[i][j] << std::endl;
}