pointers to multidimensional arrays

This is a discussion on pointers to multidimensional arrays within the C++ Programming forums, part of the General Programming Boards category; hi!
how would I declare a pointer to point to this array?
Code:
int x[3][3][2]={1,2,3,2,3,4,5,7,9,1,2,3,2,3,4,5,7,9};
Also is there a way ...

Not if you work with vectors. Then it would mean undefined behavior, pretty much.
So it could be a good exercise for those who wish to learn more about native arrays or how the hardware works, but not the language or C++.
I don't really think it's a good idea...

So you figure beginners should gloss over the fundamentals in array allocation and structure and jump straight into vectors?! And not only a simple enough vector but a vector of a vector of a vector? Seriously? I don't really thing that is a good idea. Learning from the deep end is good, but not without some kind of demonstration of previous buoyancy.

Yeah, but if you bring in hacks and stepping over bounds like yours, they're in for a surprise later when they actually do use a vector.
So I'm suggesting that they "do it by the book." Don't step over bounds and like that, that can potentially cause undefined behavior. No "advanced" tricks.
No need to start with vectors right away. But if you treat arrays as you would vectors, then there's no problem with the transition later.
(And besides, some would argue that you should learn higher-level functionality before lower, aka C++-stuff such as vector before C-stye arrays. Both have their ups and downs.)

I'm still not convinced, but what the hey. It's a trick, but by no means advanced. If the OP was familiar with how arrays are stored in memory he would understand that by incrementing the position of the pointer to the 0th element of the multidimensional array you merely iterate through all elements. And with the array constrained by these bounds, as per parameters to the function, the pointer won't go over-board.

I dunno though. The fact that vectors are completely managed will add nothing to the learning experience. If you saw this, Elysia, when learning what would you think?

? (Or is there a better way to print it? It's all I thought of, though I didn't put much effort into trying to make it better... Aside from [] operators, which I felt weren't necessary considering the OP's learning all about vectors anyway, so they might as well learn about iterators. )

I don't understand what's so dirty in that either. I don't think vector (dynamically allocated, resizable) is supposed to replace an array (on the stack, not resizable). A vector in this case would have a large memory overhead compared to the size of the contents, several small memory allocations and non-contiguous layout.

I don't think vector (dynamically allocated, resizable) is supposed to replace an array (on the stack, not resizable).

Although, I never suggested this. I agree, there is a more flexible solution for constant arrays.
But in this case, the OP asked about varying numbers of dimensions and that is the work of dynamic arrays.
Unless you want to use template functions. That's possible too.

But the thing is all these solutions (vectors, boost::array, boost::multi_array), while they're all good solutions in themselves but, unless I'm mistaken, from the OP's point of view it might be like driving a Formula1 car when he knows how to drive a regular one[1]. Why introduce layers of complexity (templates, third party libraries and even standard libraries), when it's not required and frankly might only serve to confuse the OP. Somehow reminds me of this.