TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CAMERON CLARK
from: BALOG PAL
date: 1997-08-30 19:25:00
subject: !!StackControl???

                             Hi, Cameron Clark!
On 27 Aug 97  20:20:53 you wrote to Anthony Tibbs
 AT>  Q. How do I change the stack size?
 AT>  A. The size of the stack of a Turbo C++ program is determined at
 AT>     run time by the global variable _stklen. To change the size
 AT>     to, for example, 10,000 bytes, include the following line in
 AT>     your program:
 AT>
 AT>       extern unsigned _stklen = 10000;
In C++ it probably must be declared as extern "C" unsigned ...
 CC> That's the strangest thing I've ever seen (runtime adjustment).
That's not runtime adjustment. The stack is allocated in the strtup code, and
uses the value in _stklen. Is you change it afterwards (say as first line in
main()) that will have no effect.
 CC> Are there any sideffects to changing the variable at different
 CC> places?
No side effect other than they both are ignored. :)
Paul
... Beware of programmers who carry screwdrivers
--- OS/2 Warp
---------------
* Origin: The FlintStones' Cave in BedRock (2:371/20)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.