passing pointers to function that takes a reference?

Viewed 6594

In C++, when you have a function that takes a reference to an object, how can you pass an object pointer to it?

As so:

Myobject * obj = new Myobject();

somefunc(obj);  //-> Does not work?? Illegal cast??

somefunc(Myobject& b)
{
 // Do something
}
2 Answers
Related