I have a very large array which must be 262144 elements in length (and potentially much larger in future). I have tried allocating the array on the stack like so:
Your syntax for using new
was wrong, it should be:
int *myArray = new int[262144];
you only need to put the size on the right of the assignment.
However, if you're using C++ you might want to look at using std::vector (which you will have) or something like boost::scoped_array to make the the memory management a bit easier.