I need to use an array with size 900000. However, the program fails to run. How can I solve it?
I used Visual C++ 6.0.
e.g
double data[900000];

Recommended Answers

All 2 Replies

Yeah, 900000 doubles is too big for a static declaration. Use double *data = new double[900000]; instead.

And don't forget to delete [] data; when you're done using it, or else you'll never reclaim the memory.

I used Visual C++ 6.0.

That's an antique, you know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.