farmerdoug
05-26-2010, 11:32 AM
I have to make multiple calls to MatDoub and VecDoub. How do I free the memory each time I'm through with the previous allocation?
davekw7x
05-26-2010, 12:33 PM
I have to make multiple calls to MatDoub and VecDoub. How do I free the memory each time I'm through with the previous allocation?
MatDoub and VecDoub are not functions that you call. They are classes for which you can create objects.
Speaking in general terms:
New objects are created (memory is allocated) when you invoke a constructor.
Memory allocated by invoking a constructor is automatically de-allocated by the object's destructor. (You don't invoke a destructor explicitly; the destructor is called automatically when an object goes out of scope).
If this doesn't help, then give us a small complete (compilable) example of what you are trying to do. Maybe someone can help with your specific problem.
Regards,
Dave