First of all.. I have some memory management problem in my source code.
I know the reason roughly. it is non-pointer object.
in some function using pointer-object, no problem is there.
I want to know how I can delete memory by allocated by non-pointer object ?
Actually the situation is this..
class ABC{
...
};
int main()
{
ABC abc(1, 1); // just arbitrary parameters for constructor.
...
...
return 0;
}
in this source code, the constructed object "abc" is not deleted explicitly..
so..
If I constructed many objects, the executable program is not over without any memory trouble even though the outcome is correct.
I usually make many classes..
Some object is constructed as pointer type and no error is occurred in this cases.
(in this case, the destructor is called..)
that is, my point is how to memory de-allocator when I use non-pointer object ?
Local variables are allocated on the stack and are managed automatically. You don't call delete on them. Their destructors are called when they go out of scope.