Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save pointer address

Status
Not open for further replies.

sergelaurent

Technical User
May 30, 2005
52
FR
i would like to save the address of a pointer in a Table;

The problem is that i can't do "Tab = Ptr" because the type is different;

How can i save the address in my table ?

thanks,

 
There seems to be some confusion. As long as Tab is an array of pointers then there is nothing wrong with Tab = Ptr;

For example
Code:
char *cPtr; /* A pointer to a char */
char szBuffer[256]; /* An array of chars */
char *PtrArray[256]; /* An array of pointers to chars */

PtrArray[0] = cPtr; /* valid */
ptrArray[1] = szBuffer; /* valid */
szBuffer[0] = cPtr; /* WRONG - type difference */
I hope this makes things clearer

Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top