Homework/HW01/MyArray.cc
void MyArray::empty()
{
    // make sure we have an array to delete
    if (size != 0 && array != NULL) 
    {
        size = 0;
        delete [] array;
        array = NULL; // make the pointer NULL after deallocating 
    }
}
// Deallocate the array and reset the size to 0
Deallocate the array and reset the size to 0
Deallocate the array and reset the size to 0
void MyArray::empty()
{
    if (size != 0 && array != NULL) 
    {
        size = 0;
        delete [] array;
        array = NULL; 
    }
}
void MyArray :: empty ( ) { if ( size != 0 && array != NULL ) { size = 0 ; delete [ ] array ; array = NULL ; } }
Deallocate the array and reset the size to 0
Deallocate the array and reset the size to 0
// make sure we have an array to delete // make the pointer NULL after deallocating 