Reversing Linklist using Stack.
I have created linklist using <list> STL. Now I want to push address of each node in Stack. For that I want address of 1st node so that I will assign it to "temp" and I can use following loop.
But I am not getting address of 1st node. I tried function l1.front() which gives 1st element but not address.HTML Code:while (temp != NULL) { s.push(temp); temp = temp->next; }
Can anyone help me ?




Reply With Quote
