• Announcements

Archived

This topic is now archived and is closed to further replies.

Pointer to Object

Recommended Posts

int ME = 5;//make int
int *v=&ME;//make pointer to int
int d=v;   //make number equal to int that pointer points to (WARNING!)

Is there a way that I can do this. I have finally run into a problem that requires me to do this, normaly I find a way around it but This time there isn''t one. please help.

Share on other sites
quote:
Original post by Xero-X2
int ME = 5;//make intint *v=&ME;//make pointer to intint d=v;   //make number equal to int that pointer points to (WARNING!)

Is there a way that I can do this. I have finally run into a problem that requires me to do this, normaly I find a way around it but This time there isn't one. please help.

do this

  int ME = 5;int *v = &ME;int d = *v;

now d will have the value of *v and not the address. Hope that helps.

"You have Freedom, sir"
"Were do I have freedom"
"My FREEDOM isn't for sale"

[edited by - Mars_999 on October 19, 2002 11:12:24 PM]

• Forum Statistics

• Total Topics
627714
• Total Posts
2978775

• 9
• 21
• 14
• 12
• 42