title: What is the use of creating objects on the free store?
body: <pre><code>void fun()
  {
      A *a = new A;   //Here A is a class
  }                   //a should be deleted in fun()'s scope
  
  int main()
  {
      fun();
      return 0;
  }
  </code></pre>
  
  <p>The object created exists on the free store and cannot be used by the main() function. The why should the objects be created on the free store. Yes we can pass the object reference to the main function but we can even pass a copy of the object(even when not created using the new operator). Then what's the exact use of the new and delete operator?</p>