Hi-
What's the diffreence between doing this:
and this:Code:Node *temp; temp = new Node; temp->data=x;
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.Code:Node *temp; Node n; n.data = x; temp = &n;