Hi-
What's the diffreence between doing this:
Code:
Node *temp;
temp = new Node;
temp->data=x;
and this:
Code:
Node *temp;
Node n;
n.data = x;
temp = &n;
When I use the first one, I get the expected results for temp, so I guess that's correct, but I don't understand why the second one wouldn't also work.