I'm learning about destructors a bit, and wanted to see if this is the right way to write them externally as opposed to inside the Class.
class Foo
{
private:
int* array;
int arraySize;
public:
Foo(int size) // Assume "size" is > 0
{
arraySize = size;
array = new int[size];
}
~Foo();
};
Foo::~Foo() {
delete array;
delete &arraySize;
}