Create a class Rock with a default constructor, a copyconstructor, an assignment operator, and a destructor, all
of which announce to cout that they’ve been called. In
main( ), create a vector (that is, hold Rock objects
by value) and add some Rocks. Run the program and
explain the output you get. Note whether the destructors
are called for the Rock objects in the vector. Now repeat
the exercise with a vector<Rock*>. Is it possible to create
a vector<Rock&>?
Create a class Rock with a default constructor, a copyconstructor, an assignment operator, and a destructor, all of which announce to cout that they’ve been called. In main( ), create a vector (that is, hold Rock objects
by value) and add some Rocks. Run the program and
explain the output you get. Note whether the destructors
are called for the Rock objects in the vector. Now repeat
the exercise with a vector<Rock*>. Is it possible to create
a vector<Rock&>?