Very specific problem, possibly due to my generally poor understanding of multidimensional arrays in C. I’ve got this code:
int io_pipes[NUM_IO_PROC][n][2][2];
for (int i = 0; i < n; ++i) {
int pipes[NUM_IO_PROC][2][2];
for (int j = 0; j < NUM_IO_PROC; ++j) pipes[j] = io_pipes[j][i];
}
There’s some stuff missing, of course (like what happens to the pipes variable). Problem is that on line 5 there, I get a compiler error that say “incompatible type in assignment.” I’d like it if the compiler gave me more information because as far as I know, pipes[j] and io_pipes[j][i] are both of type int[2][2].
You cannot ‘assign’ arrays. (At least, what I think you’re trying to do.)
You’ll need to copy each element, one by one. Maybe you can use one of the existing library functions for this task?