I'm not a C++ programmer, and I have great respect for its complexity, so I'd normally stay away from it. Despite this, I've found a certain library I'd like to tinker with.
The library includes a sample snippet where a single instance is allocated in local scope:
Foo foo(arg1, arg2, ...);
I want to modify this example to re-initialize the object and do more things with it, but I can't do it via getters/setters or public variables. Is this possible without creating more instances?
In case there's no way of doing that without creating new instances, how could I release the memory of the objects I no longer need?
For instance, if it were a dynamic object, I guess it would be something like this:
Foo* pfoo;
pfoo = new Foo(arg1, arg2, ...);
pfoo->doSomething();
delete pfoo;
pfoo = new Foo(arg3, arg4, ...);
pfoo->doSomething();
delete pfoo;
What would be the equivalent for the object allocated in the stack?