I have an assignment where I hav eto use a string. I kinda know how to use the pointer based string, but don't really know how to use class based string, so thats the reason for this post...

This is what I have to do....

Create a Rabbit class. Let that class have an instance variable called eyeColor. Make eyeColor a string . In the Rabbit constructor, use an initializer list to initialize the eyeColor instance variable. Declare the constructor such that it receives a reference to a string as the eyeColor parameter. Specify a class variable (that means it will be a static variable) call population that acts as a counter of the number of Rabbit object that have been instantiated. That means that in your constructor you’ll need to increment the population variable, and in your destructor you’ll need to decrement your population variable.
Define a displayProperties() method that displays the eyeColor of the Rabbit and the population value. In your Rabbit destructor, call the displayProperties method.

How do I do this using a class based string?

This is the main.cpp i was given....

Code:
int main()
{
   Rabbit *rabbit1Ptr = new Rabbit(“Blue”);
   rabbitPtr->displayProperties();

   Rabbit *rabbit2Ptr = new Rabbit(“Green”);
   Rabbit2Ptr->displayProperties();

   Rabbit *rabbit3Ptr = new Rabbit(“Red”);
   Rabbit3Ptr->displayProperties();

   Rabbit *rabbit4Ptr = new Rabbit(“Red”);
   Rabbit4Ptr->displayProperties();

   Rabbit *rabbit5Ptr = new Rabbit(“Red”);
   Rabbit5Ptr->displayProperties();

   Rabbit *rabbit6Ptr = new Rabbit(“Red”);
   Rabbit6Ptr->displayProperties();

   Rabbit *rabbit6Ptr = new Rabbit(“Red”);
   Rabbit6Ptr->displayProperties();

   Rabbit *rabbit7Ptr = new Rabbit(“Red”);
   Rabbit7Ptr->displayProperties();

   Rabbit *rabbit8Ptr = new Rabbit(“Red”);
   Rabbit8Ptr->displayProperties();

   Rabbit *rabbit9Ptr = new Rabbit(“Red”);
   Rabbit9Ptr->displayProperties();

   Rabbit *rabbit10Ptr = new Rabbit(“Red”);
   Rabbit10Ptr->displayProperties();

   //Now let’s kill all the Rabbits! (So said Elmer Fudd.)
   delete rabbit1Ptr;
   delete rabbit2Ptr;
   delete rabbit3Ptr;
   delete rabbit4Ptr;
   delete rabbit5Ptr;
   delete rabbit6Ptr;
   delete rabbit7Ptr;
   delete rabbit8Ptr;
   delete rabbit9Ptr;
   delete rabbit10Ptr;
   
   return 0; // indicate successful termination
} // end main