How do you specify a reference to a pointer

J

jessica_boxer

I want to specify a reference to a pointer. I tried this syntax, and it
didn't compile.

void func(string s, (Type*)& t);

Any thoughts?
 
A

Andre Kostur

(e-mail address removed) wrote in @l53g2000cwa.googlegroups.com:
I want to specify a reference to a pointer. I tried this syntax, and it
didn't compile.

void func(string s, (Type*)& t);

Any thoughts?


void func(string s, Type *& t);


I suspect that the compiler is attempting to take the address of t, then
casting it to a Type* in your version.
 
P

Puppet_Sock

I want to specify a reference to a pointer. I tried this syntax, and it
didn't compile.

void func(string s, (Type*)& t);

Any thoughts?

The following seems to work for me.

#include <string>

class Type
{
public:
int someData;
};

void func(std::string s, Type* & t);

Socks
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top