Normally when you start getting lots of dimensions you may want to rethink your design as it consumes a lot of memory.
Yes you can declare it as above for three dimensions, you just need to allocate it in similar manner as before.
Alternatively you allocate one block of memory and place pointers into it, that way it is easy to free and which is - depending on OS - often faster to allocate.