passing ref to ptr again as ref to ptr....

O

osama178

Let's say I have this code

--------------------
class GenericQueue
{
bool Pop(void*& refToPtr); // //--------------------(1)


};

class SpecialQueue: private GenericQueue
{
public:
bool Pop(T*& refToPtr)
{
return GenericQueue::pop(refToPtr); //--------------------(2)
}

};

..... The statement in (2) generates an error.

I know it doesn't compile because we're passing a pointer in (2) to a
function that expects a reference to a pointer, but as soon as we go
into the code block in (2), refToPtr becomes just the pointer. How do
I get it as a reference to pointer so I can pass it correctly?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top