Use dynamic allocation (new for C++ and malloc() for C). I'm not sure about the syntax for malloc() (always used new ), but it is something like this:
Originally posted by mindrebel
b) it seems like defining an array size must be done with only constans, is it really just this way? if not, how can I define
one (array) with variables (like int A[x][y]?
//Create a pointer
//Check if the allocation was successful
//*** Do whatever you want ***
//Deallocate the memory. If you don't do this, you
//will end up with memory leaks. ONLY deallocate if it
//has been allocated, might crash otherwise...