Did you try it on Win 2000/XP?

>From: Paulo de Oliveira Eneas <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: [c-prog] Global Variable x Stack Overflow
>Date: Tue, 30 Nov 2004 11:11:55 -0200
>
>
>Dear list members,
>
>I working in a project that uses a very big struct whose size is approx 4.0
>MB.
>If I declare a struct variable within the main (actually, winmain) function
>I get a stack overflow and the programm crashes. If I declare  the
>structure variable in the global scope, everything goes OK.
>
>
>//File: MyHeader.h
>struct  DATA
>{
>// members, including other structs
>// (...)
>};
>
>// This works fine:
>// File: MyProg.cpp
>#include <iostream>
>#inlude <"MyHeader.h">
>using namespace std;
>DATA data;
>int main( )
>{
>  // ....
>  return 0;
>}
>
>// This causes a stack overflow:
>// File: MyProg.cpp
>#include <iostream>
>#inlude <"MyHeader.h">
>using namespace std;
>int main( )
>{
>  DATA data;
>  //....
>  return 0;
>}
>
>Is this a situation in which the use of global variable is mandatory?
>I would really appreciate your comments.
>
>
>Development Environmet:  Microsoft VC++ 6.0
>Machine: IBM based PC  running  Windows 98 OS
>Targeting: Win9x / 2000 / xp
>
>Regards,
>Paulo de Oliveira Eneas
>Sao Paulo / SP
>Brazil
>
>

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/






To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=294855.5468653.6549235.3001176/D=groups/S=:HM/A=2376776/rand=238090687


Yahoo! Groups Links

Reply via email to