Is it possible to convert a one-dimensional array to a two-dimensional array?
First of all, it will be very simple, just set the pointer of the 2D array to the beginning of the 1D array as follows:
int foo[] = {1,2,3,4,5,6}; int bla[2][3] = foo;
because I can easily create a two-dimensional array as follows:
int bla[2][3] = {1,2,3,4,5,6};
so now the question is, is there a way to convert it through a pointer?
source share