mirror of
https://github.com/TREX-CoE/Sherman-Morrison.git
synced 2024-11-03 20:54:08 +01:00
24 lines
607 B
C++
24 lines
607 B
C++
|
#include <iostream>
|
||
|
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
|
||
|
typedef int (*to2D)[3]; //pint2 is a pointer to an array of 2 ints
|
||
|
int linArray[9] = {0,1,2,3,4,5,6,7,8};
|
||
|
|
||
|
to2D dArray = (to2D)linArray;
|
||
|
|
||
|
std::cout << dArray[0][0] << std::endl;
|
||
|
std::cout << dArray[0][1] << std::endl;
|
||
|
std::cout << dArray[0][2] << std::endl;
|
||
|
std::cout << dArray[1][0] << std::endl;
|
||
|
std::cout << dArray[1][1] << std::endl;
|
||
|
std::cout << dArray[1][2] << std::endl;
|
||
|
std::cout << dArray[2][0] << std::endl;
|
||
|
std::cout << dArray[2][1] << std::endl;
|
||
|
std::cout << dArray[2][2] << std::endl;
|
||
|
|
||
|
return 0;
|
||
|
}
|