Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Large Data Arrays 1

Status
Not open for further replies.

porto99

Technical User
Nov 1, 2004
96
0
0
GB
In my application I needed to increase one of the fields within a structure from 256 to 4096 (char array), now this structure is part of an array, typical size is 1024 elements.

I get some funny results from enumerated data.

I was wondering if they are any compiler options to increase the stacks etc for this large amount of data.

I am using Visual Studio 2005 MFC C++ Dialog application.

Do I need to worry, or is it just a bug in my program?

Porto.
 
Well the simple fix is to change
[tt]struct myarray[SIZE];[/tt]
to
[tt]static struct myarray[SIZE];[/tt]

This preserves all the scope which the array originally had, but the compiler no longer tries to store it on the stack.

> I was wondering if they are any compiler options to increase the stacks etc for this large amount of data.
There's a linker option.

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top