Reference on interface as a parameter
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/114180/pointer-vs-reference">Pointer vs. Reference</a>  </p>
</blockquote>



<p>I am wondering if there any benefits in using references instead of pointers on some interface. Being more specific let's consider small example:</p>

<pre><code>struct MyInterface {
   virtual ~MyInterface() {}
   virtual void f() = 0;
};

class MyClass : public MyInterface
{
   virtual void f()
   {
      std::cout &lt;&lt; "F()" &lt;&lt; std::endl;
   }
};


void myFunction(MyInterface&amp; obj);

int main(int argc, char *argv[])
{
   MyInterface* pObj = new MyClass;

   myFunction(*pObj);

   delete pObj;

   getchar();
   return 0;
}

void myFunction(MyInterface&amp; obj)
{
   obj.f();
}
</code></pre>

<p>In <em>myFunction</em> instance of <em>MyClass</em> can be passed as a pointer, what is written in many books. My question is what can be considered as a good practice (pointer or reference) and what is more efficient?</p>

<p>Sorry if this question somehow was asked previously. </p>
