In Win32 Console Application (Visual C++) I have a array of objects and each object contains some other objects and variables, ex. (Owner and Equipment are structs, TimeInfo is class):
class Order
{
public:
Order();
~Order();
Owner owner;
Equipment equipment;
char *problem;
TimeInfo timeinfo;
void write();
int order_number;
};
Next I have class OrderManager, that contains the array of this object:
items = (Order*)(malloc(100 * sizeof(Order)));
In program, I add and remove items, but what is the best way to free memory at the end of program? I have free(manager.items);, but this doesn't work.