DEV Community

Discussion on: How can you swap two variables without using a third?

 
theoutlander profile image
Nick Karnik

That's awesome. I did not know about it. I wonder if it swaps values instead of pointters.

Found this on SO @ stackoverflow.com/questions/445179....

StackOverflow Answer

Thread Thread
 
almostconverge profile image
Peter Ellis

So now we've reduced the problem to "How do you swap the two topmost stack items?" :)