First, I'll admit this is homework but it has been around six years since I last programmed in C and ever since I have been only programming in Python and Java.
I want to generate successor 2D arrays to a 2D array for example:
[1][2][3]
[4][5][6]
[7][8][ ]
For the 2D array above, the successor 2D arrays would be:
[1][2][3]
[4][5][6]
[7][ ][8]
and
[1][2][3]
[4][5][ ]
[7][8][6]
This wouldn't be a problem if I just placed the code for this in a main() method.
However I want to separate the code for this part and encapsulate it in a function and just call it when I need it. In other words, I want to generate both arrays from inside a function and return both of them.
In C this is isn't as straightforward because I can't make a function that can pass an array of 2D arrays.
I have some ideas like
return a struct with a 2d array and next variable that is a pointer to another successor 2D array (I want to process all the successor arrays in a loop).
create a global pointer where I will point the head to the first struct, which in turn points to the next succesor 2d array and so on.
But I am not really confident which one to try. Looking for other helpful leads.