I have a class that creates a vector of objects. In the deconstructor for this class I\'m trying to deallocate the memory assigned to the objects. I\'m trying to do this by
If you're using std::vector then you can just let it get handled by the destructor for vector, assuming there are "objects" (and not pointers to objects) in said vector.
-- or --
If you're using a standard array as the "vector":
The purpose of the "delete []" variation is to deallocate an entire array, and hence avoid the need to have a for loop like you do.
If using standard C/C++ arrays, "delete [] maps" should do it for you. "[]" shouldn't be used for deallocating STL vectors.