I want to have a static array with arrays in it. I know you can make a normal array like this:
int test[] = {1,2,3,4};
But I want to do something like this (Xcode gives me a bunch of warnings and stuff):
int test[] = {{1,2}, {3,4}};
In python it would be:
arr = [[1,2], [3,4]];
What’s the proper way to do this?
To have a multidimensional array, you’d need two levels of arrays:
However, that will not work, as you need to declare the size of the inner-most arrays except the last one:
Or if you need an even stricter type safety: