DEV Community

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

Collapse
 
theoutlander profile image
Nick Karnik • Edited

Aren't you using a third register though?

Are you're thinking that you can do that because it's not in RAM?

Thread Thread
 
zhu48 profile image
Zuodian Hu

The way the question is formulated, you're limited by having a certain amount of memory. Any register use doesn't count against that at all.