Re: [Dev-C++] declare a two-dimension array
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2006-12-13 21:25:38
|
Don't try to statically allocate huge objects on the stack!
1024*512*4 is 2MB.
Depending on architecture, there are often a limited size the stack may
be.
Depending on architecture and compiler, there is also sometimes a limit to
how much the stack may grow for each function call - it depends on how the
compiler generats code to touch guard pages to let the OS allocate more
memory pages for the stack.
If you want a large array, either allocate it dynamically or create the
array as a global object.
/Per W
On Wed, 13 Dec 2006, Hi, There wrote:
> Hi, There,
>
> I want to declare a two-dimension array by
> "float coeftemp1 [1024][512];". It doesn't work.
>
> But, if I change it to "float coeftemp1 [1024][500];".
> It works. Could any one know the reason?
>
> Thank you,
>
>
>
>
> //**************************
> #include <cstdlib>
> #include <iostream>
>
> using namespace std;
>
> int main(int argc, char *argv[])
> {
> float coeftemp1 [1024][512];
> system("PAUSE");
> return EXIT_SUCCESS;
> }
> //**************************
>
>
>
>
> ____________________________________________________________________________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
> http://new.mail.yahoo.com
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|