• ### Announcements

#### Archived

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

# Pointer to Object

## Recommended Posts

Xero-X2    184
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
MARS_999    1627
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"