cloke
2002.06.23, 05:54 PM
I have a very simple pointer question. I want to pass two pointers to a function and point the second pointer the the location of the first pointer. This seems like such a simple thing, but for some reason I can't get it to work.
int main( void )
{
NODE *p = new NODE, *b = NULL;
ApplendNode(p, b);
//b should now be the value of p, but it is not.
}
void ApplendNode(NODE *p, NODE *b)
{
b = p;
}
Thanks in advance for any suggestions.
int main( void )
{
NODE *p = new NODE, *b = NULL;
ApplendNode(p, b);
//b should now be the value of p, but it is not.
}
void ApplendNode(NODE *p, NODE *b)
{
b = p;
}
Thanks in advance for any suggestions.