NathanOliver is almost right, but I at least do like to distinguish "define" and "declare". A declaration is about type whereas a definition is about value. So I would say you could declare it as int* spaces . Since this is C++, you do have access to all the STL classes which in my opinion make both programming and learning to program easier, so I continue to recommend that frenchie4111 consider using a std::vector unless his teacher says not.
I do agreee that vectors do have advantages but this is still c++. It is still usefull to know how to do these things because there are times when you would be better of with a 2d array instead of a 2d vector.
Of course some C++ programmers will need to understand how to deal with pointers to multi dimensional arrays, but I suspect many student programmers never will need such skills, so I'm really talking more about the order that concepts are introduced to new C++ programmers. I started from C, so I had my trial by fire before I ever heard of C++. Perhaps because of that, I may appreciate more than most how much easier it is now than it was before there was an STL in the standard.
My own take, which is certainly not universal, is that student programmers will make much better progress if we introduce string, vector, iteration, etc earlier rather than later; and allow them to concentrate at first on what it means to do programming, rather than how to overcome what will seem to them like obscure and esoteric errors.
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...