#include <iostream>
#include <ios>
int main()
{
int ia[ 2 ][ 4 ] = { { 1, 3, 5, 7 }, { 2, 4, 6, 8 } };
//int** ip = ia;
int* ip = reinterpret_cast< int* >( ia );
std::cout << std::hex << ia;
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::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;
for ( int i = 0 ; i < 2 ; ++i )
{
for ( int j = 0 ; j < 4 ; ++j )
{
//std::cout << ip[ i ][ j ] << ' ';
std::cout << *( ip + 4 * i + j ) << ' ';
}
std::cout << std::endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9zPgoKaW50IG1haW4oKQp7CglpbnQgaWFbIDIgXVsgNCBdID0geyB7IDEsIDMsIDUsIDcgfSwgeyAyLCA0LCA2LCA4IH0gfTsKCgkvL2ludCoqIGlwID0gaWE7CglpbnQqIGlwID0gcmVpbnRlcnByZXRfY2FzdDwgaW50KiA+KCBpYSApOwoKCXN0ZDo6Y291dCA8PCBzdGQ6OmhleCA8PCBpYTsKCXN0ZDo6Y291dCA8PCAiIGlhIiA8PCBzdGQ6OmVuZGw7CgoJc3RkOjpjb3V0IDw8ICItLS0iIDw8IHN0ZDo6ZW5kbDsKCglmb3IgKCBpbnQgaSA9IDAgOyBpIDwgMiA7ICsraSApCgl7CgkJZm9yICggaW50IGogPSAwIDsgaiA8IDQgOyArK2ogKQoJCXsKCQkJc3RkOjpjb3V0IDw8IHN0ZDo6aGV4IDw8ICYoIGlhWyBpIF1bIGogXSApOwoJCQlzdGQ6OmNvdXQgPDwgIiBpYVsgIiA8PCBpIDw8ICIgXV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