Use a std::vector, you create it like this: std::vector<float> x ( nx ); ( vector of floats called 'x' containing 'nx' elements )
Then you can use it as an array, but it has the advantages of being re-sizable and managing memory itself
I'm glad i found this topic. What if i want to create a two-dimensional array? It does not work:
int * array = newint[2][number];
The same shit: "must be a constant value", but just with Y (number), the X (2) seems to be good. The "number" is a pre-defined value, i have to use it. It works with one-dimensional array, but not with two-dimensional. I know how to use vectors, but it's a little part of a function and also want to learn how to do with this.