calling legacy function with shared pointer
<p>i am trying to call a legacy function, which takes normal pointer parameter, with a shared pointer and i am getting the following error:</p>

<p>I have tried to convey the idea, by a simple example, what i am doing. I cannot change the parameter to display(), as it is in legacy and is being used by many other modules..But from my function, i am using shared pointer to call display. Is it correct ? Can you please suggest/advice ?</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

#include &lt;boost/shared_ptr.hpp&gt;

void display(int * x)
{
    cout &lt;&lt; endl &lt;&lt; "Pointer value is = %x" &lt;&lt; *x;
}
int main(){

    boost::shared_ptr&lt;int&gt; ptr( new( int ) );

    *ptr =5;

    display(ptr);
    return 0;
}
</code></pre>

<p><strong>sh.cpp: In function 'int main()':
sh.cpp:17: error: cannot convert 'boost::shared_ptr' to 'int*' for argument '1' to 'void display(</strong></p>
