I am using a C++ library to build a GUI app in C++. The lib requires me to start all of my code from an init() and free it all through a shutdown() which are called (respectively) from the constructor and destructor.
I could easily just instantiate a class of mine in init() which starts all of my code and listeners, e.g.:
MyApplicationStuff* appObj;
...
void init(){
MyApplicationStuff appObj = new MyApplicationStuff();
}
But this would place that object in the free store and most of the code executed from within that object (basically my entire app) utilizes automatic objects (stack-based).
My Question:
If my app were designed to utilize the stack, would calling 'new' to start up my app cause everything to be in the free-store... even my automatic/local variables?