#include <iostream>
#include <ios>
int main()
{
int ia[ 2 ][ 4 ] = { { 1, 3, 5, 7 }, { 2, 4, 6, 8 } };
int (*ip)[ 4 ] = ia;
std::cout << std::hex << ia << std::dec;
std::cout << " ia" << std::endl;
std::cout << "---" << std::endl;
for ( int i = 0 ; i < 2 ; ++i )
{
for ( int j = 0 ; j < 4 ; ++j )
{
std::cout << std::hex << &( ia[ i ][ j ] ) << std::dec;
std::cout << " ia[ " << i << " ][ " << j << " ]" << std::endl;
}
}
std::cout << "---" << std::endl;
std::cout << "sizeof( ia ) == " << sizeof( ia ) << std::endl;
std::cout << "sizeof( ip ) == " << sizeof( ip ) << std::endl;
std::cout << "---" << std::endl;
std::cout << "sizeof( int[ 1 ] ) == " << sizeof( int[ 1 ] ) << std::endl;
std::cout << "sizeof( int[ 2 ] ) == " << sizeof( int[ 2 ] ) << std::endl;
std::cout << "sizeof( int[ 3 ] ) == " << sizeof( int[ 3 ] ) << std::endl;
std::cout << "sizeof( int[ 4 ] ) == " << sizeof( int[ 4 ] ) << std::endl;
std::cout << "---" << std::endl;
std::cout << "sizeof( int[ 4 ] ) == " << sizeof( int[ 4 ] ) << std::endl;
std::cout << "sizeof( int (*)[ 4 ] ) == " << sizeof( int (*)[ 4 ] ) << std::endl;
std::cout << "sizeof( int (*[ 2 ])[ 4 ] ) == " << sizeof( int (*[ 2 ])[ 4 ] ) << std::endl;
std::cout << "sizeof( int** ) == " << sizeof( int** ) << std::endl;
std::cout << "---" << std::endl;
for ( int i = 0 ; i < 2 ; ++i )
{
for ( int j = 0 ; j < 4 ; ++j )
{
std::cout << ip[ i ][ j ] << ' ';
}
std::cout << std::endl;
}
return 0;
}