I have the following code
int vertical[] = {0, 1};
int horizontal[] = {1, 0};
int diag1[] = {1, 1}, diag2[] = {1, -1};
int directions[][] = {vertical, horizontal, diag1, diag2};
Which gives me the following error on line 5:
Array has incomplete element type 'int []'
Thus, I'm stuck doing the following:
int directions[4][2] = {{0,1},{1,0},{1,1},{1,-1}};
How can I define directions[][] using the four 1d arrays?
std::array? We are in 2021 with C++20 and people are still using C arrays.