Hi everyone,
I have a question about destructors. I've written a simple class, to simulate a fertiliser tanker using a header file and an implementation file. Then I've used a file with a main method to test it.
Everything is working fine, except for the destructor I have written. I've included a cout statement, so that it is possible to tell that the destructor has been called, but the output is not being showed. I'm compiling everything in DevC++, but running it from the command line.
My code for the destructor in the header file is:
in the implementation file the code is:Code:~Tanker();
I've written destructors before, and they have worked. They were single file programs, with main method, class declarations and implementation all in the same file.Code:Tanker::~Tanker() { cout << "Tanker object destroyed" << endl; }
I'm not sure if I'm missing something here? Like I say, everything else is working fine.
Thanks for your help,
Justin