title: C++ : Prevent a Class from Initialization
body: <p>I have a class and in the class constructor I want to check few parameters that have been passed, if any parameter fails the check, I want to prevent the class from initialisation. How can I do that ?</p>
  
  <pre><code>Class MyClass
  {
   MyClass(int no);
  };
  MyClass::MyClass(int no)
  {
    if(no&lt;0) // Prevent the Class from Initialisation
  }
  
  void main()
  {
         MyClass myobj(-1);
  
         // How to check if myobj is an objecT???
         //  if(myobj!=null) ???
   }
  </code></pre>