If I have a class that looks something like this:
class SomeClass {
public:
SomeClass(int size) {
arr = new int[size];
someInt = size / 10;
};
~SomeClass() {
delete [] arr;
//do I need to somehow delete the int value 'someInt'?
};
private:
int *arr; //pointer to dynamically allocated array
int someInt;
}
What, exactly, should be contained in the destructor to avoid memory leaks?
I am aware that I need to delete the array, since it is dynamically allocated, but do I need to do anything with int values, or other basic data types?
Thanks, Jonathan