I'm relatively new to programming, and I need to enter in a 4-dimensional array, and I can barely wrap my head around it. So, let's start with a simple 3-d array, 2 elements each like so:
int arr[2][2][2] =
{
{
{1, 2}
{3, 4} //redline on "{"
}
{ //redline on "{"
{5, 6}
{7, 8}
}
};
VS-2012 redlines the "{" before the "3", and says it's expecting a "}" instead. How would I be able to enter the array in a neat format? Having 4 dimensions will make it more complicated, and I need to be able to see the data clearly.
Also, I'm going to have a good number of zeroes in my array, in essense every arr[n][n] will be 0, so I'm wondering if I can make the initialization a little simpler.
my array will be of the type
int arr[7][7][15][2]
Or am I better off using struct instead?
Thanks in advance!