Development C++ Tutorial

#include
class MyClass
{
  static int total;
public:
  MyClass()
  {
    total++;
  }
  ~MyClass()
  {
    total--;
  }
  int gettotal()
  {
    return total;
  }
};
int MyClass::total=0;
main()
{
  MyClass o1,o2,o3;
  cout<  MyClass *p;
  p=new MyClass;
  if(!p)
  {
    cout<<"Allocation erroe\n";
       return 1;
  }
  cout<  cout<<" object in existence after allocation\n";
  delete p;
  cout<  cout<<" object in existence after deletion\n";
  return 0;
}
3 objects in existence
4 object in existence after allocation
3 object in existence after deletion