N
N
Noortvel2018-12-07 09:10:42
C++ / C#
Noortvel, 2018-12-07 09:10:42

An array of two-dimensional arrays?

How to create an array of two dimensional arrays?

int a0[2][2] = { {1,0}, { 0,1}};
int a1[2][2] = { {1,1}, {0,0}};
//??? не работает
int[2][2] ar[] = {a0, a1};

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Noortvel, 2018-12-07
@Noortvel

int a0[2][2] = { {-1,0}, {0,0} };
int a1[2][2] = { {1,1}, {0,0} };
int (*ar[2])[2] = { a0, a1 };

V
Vladimir Proskurin, 2018-12-07
@Vlad_IT

This is already a three-dimensional array.

int arr[2][2][2] = {{ {1, 2}, {1, 2} }, { {1, 2}, {1, 2} } };

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question