title: Confusing with delete and free function in C++
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/240212/what-is-the-difference-between-new-delete-and-malloc-free">What is the difference between new/delete and malloc/free?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>class Foo
     {
      public:
       Foo() { x =  new int; } 
       ~Foo() { delete x; }
      private:
          int *x;
     };
  
    Foo *p = new Foo[10];
    free ( p );
  </code></pre>
  
  <p>I am getting confuse with the above code.
  Is there any problem about it?</p>