#include <iostream>
// #include <memory>

class MyObjectType;

class MyObjectType
{
public:
  MyObjectType(); /* Evil constructor */
  MyObjectType(int i);
  ~MyObjectType(); /* Bad destructor */
  
  void HelloWorld();
  
private:
  MyObjectType toto;
};

MyObjectType::MyObjectType()
{
  std::cout << "Hello !" << std::endl;
}

MyObjectType::MyObjectType(int i)
{
  std::cout << "Constructing with argument ..." << std::endl;
  
}

MyObjectType::~MyObjectType()
{
  std::cout << "Bye Bye ..." << std::endl;
}

void MyObjectType::HelloWorld()
{
  std::cout << "You called me ?" << std::endl;
}

void myfunc(void)
{
//  MyObjectType *myObject = new MyObjectType();
  std::auto_ptr<MyObjectType> myObject(new MyObjectType);
  
  myObject->HelloWorld();
  
  
  
  
  
  
  return;
}

int main(int argc, char **argv)
{
  myfunc();
  myfunc();
  myfunc();
  return(0);
}

