且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在C ++中创建一个大数组

更新时间:2023-11-10 07:55:46

使用动态分配或STL。最近有一个线程提出了一个非常类似的问题。请参见


Possible Duplicate:
Segmentation fault on large array sizes

Hi all

I am trying to create a very big array in the VS 2010 using C++.

When I try to create a array like below

int dp[4501][4501]
or
int dp[1000][1000]

It threw an exception "Stack Overflow" Then I change it to:

int dp[100][100]

everything is fine.

So if I want to create a big array like above, what should I do?

Best Regards,

Use dynamic allocation or the STL. There was a recent thread about a very similar question. See this.