SUPER_SOCKO wrote:
> How to write some code that print all element of the matrix with out
> code nested loops by hand?
You can just create a double loop, where the outermost loop iterates of
the number of dimensions, while the inner loop goes from 0 to
"sizeDimension(current_dim)".
However, you will need to decide yourself how to lay out a  say 
5dimensional matrix in the 2dimensional "cout space".
You will also need to calculate your indices yourself somehow, but your
already probably have your "matrix" class to help you out here, don't
you? (Or how does it otherwise implement matrix[n][m] in a 2dim.
matrix, and say matrix[n][m][p][q][r] in a 5dimensional one?) Along the
way, you will need to maintain som state variables, to keep track of
(and temporarily remember) indices you are starting at in each
direction. Some stack or listlike functionality probably; hint:
std::vector.
Another way to solve this latter is considering some kind of recursive
implementation.
Regards,
+Ben+
