#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>

class classVec2d_3{

  //make the constructor classVec2d_s() public
  //make the copy constructor classVec2d_s() public
  //make the destructor -classVec2d_s() public
public:
  classVec2d_3();
  classVec2d_3(const classVec2d_3& myClass);
  ~classVec2d_3();
  float x;
  float y;

private:
  static int count;
};  

//Make the constructor
classVec2d_3::classVec2d_3() :
  x(5.0f),y(6.0f)
{
  std::cout << "Constructing : now "
	    << ++(this->count) << " classVec2d_3 object exist\n";
}
//Make the destructor
classVec2d_3::~classVec2d_3() 
{
  std::cout << "Destructing : now "
	    << --(this->count) << " classVec2d_3 object exist\n";
}
//Make a copy constructor
classVec2d_3::classVec2d_3(const classVec2d_3& thing)
{
  //this->x = thing.x;
  //this->y = thing.y;
  x = thing.x;
  y = thing.y;
  std::cout << "Constructing : now "
            << ++(this->count) << " classVec2d_3 object exist\n";
}

//!!!!!!MUST DEFINE THE COUNT!!!!!!!			  

int classVec2d_3::count = 0;



int main()
{
  //Calling a "constuctor" using the "new" command 
  std::cout<<"constructing\n";
  classVec2d_3 *ptr1 = new classVec2d_3;
  classVec2d_3 *ptr2 = new classVec2d_3;
  classVec2d_3 *ptr3 = new classVec2d_3;
  classVec2d_3 *ptr4 = new classVec2d_3;
  
  //Print out the variable x
  std::cout<<"\n ptr1->x = "<< ptr1->x <<"\n";
  
  ptr1->x = 99.0;
  std::cout<<"\n ptr1->x = "<< ptr1->x <<"\n";
  
  std::cout<<"\n";

  //Make a copy  
  //  classVec2d_3 pt1(1.0f, 2.0f);
  classVec2d_3 copyOfThing1(*ptr1);   
  std::cout<<"\n copyOfThing1->x = "<< copyOfThing1.x <<"\n\n";

  //Calling a "destuctor" using the "delete" command 
  std::cout<<"destructing\n";
  delete ptr1;
  delete ptr2;
  delete ptr3;
  delete ptr4;

}




