Create a big array in C++ [duplicate]
Use dynamic allocation or the STL. There was a recent thread about a very similar question. See this.
Put it on the heap.
You should use dynamic allocation:
typedef std::vector<int> int_vector;
int_vector dp(10000);
A double array can be simulated by nesting arrays:
typedef std::vector<int_vector> int_double_vector;
int_double_vector dp(4501, int_vector(4501));