RE: [Dev-C++] dynamic or stack allocation ...
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <iv...@em...> - 2003-04-03 05:02:58
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Khalid El-Kary > Sent: Thursday, April 03, 2003 4:05 AM > To: Dev...@li... > Subject: [Dev-C++] dynamic or stack allocation ... > > > Hi fellows, > > right now i know that memory in the stack gets allocated for > once during the > start-up of the programm, Not only. > and dynamically allocated memory > gets allocated > while the programm is running. > > stack memory is faster at execution. In creation/destruction. > dynamic memory is slower (the time consumed by malloc/free) The time cost is not to be taken under consideration in nowadays ordinary systems (that is everything else than a microcontroller). > > but ... > > I want to know when exactly should i use stack memory and > when exactly > should i use dynamic memory ? Stack memory is very limited (typicaly 64 kb total available for a DOS program). The rest of memory can be seen as free store. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys |