#include #include #include "announcer.h" using namespace std; int main() { announcer *a[] { //an array of 3 pointers, born not pointing anywhere nullptr, nullptr, nullptr }; //Construct 3 objects in 3 separate blocks //of dynamically allocated memory. a[0] = new announcer {"m1"}; a[1] = new announcer {"m2"}; a[2] = new announcer {"m3"}; cout << "\n"; cout << announcer::howMany() << " objects exist at this point.\n\n"; //Destruct the objects (in an unusual order), and give their blocks back //to the operating system. We write delete, not delete[], because each //block hold only one object, not an array. delete a[1]; delete a[0]; delete a[2]; return EXIT_SUCCESS; }