The sort of runtime error would be good to include in your post, but it looks as if the code would either not do what you want, or give a segmentation fault, changing between the two more or less at random, most likely favoring segfaulting.
The first time the program reaches the rows loop, 'columns' and 'boxes' have only been declared, but not initialized. So all you have done is given them addresses of RAM in which to store their data, but their addresses will still have whatever data was there last, which could have been anything, and could likely be interpretted as a very large, or possibly negative, integer. This will make the part of the array the program looks for more or less random.
Keep in mind that when you say (int)array[index], you are actually looking at the address of 'array' plus 'index' int-sized blocks of memory. So if your 'index' is accidentally too large, it will be looking outside of the declared boundaries your program is alotted in RAM. That is what a segmentation fault (or just segfault) is.
So, if it passes that part safely, it will still have the problem with 'boxes' in the columns loop. If it manages to pass that part without segfaulting, then after it leaves the boxes loop, the values for 'columns' and 'boxes' will be their maxes. So every next time through the rows loop, 'columns' and 'boxes' will be their maxes, and every time in the columns loop, 'boxes' will still be at max, which is very redundant.
I hope that makes sense.
If I understand the goal of this function, you should have
|
multi_array[rows][columns][boxes] = number;
|
only within the innermost loop.