About the article

Swapping without a Buffer


Most programmers will have their own library of commonly used snippets of code. One task that appears very often is the exchange of the contents of two variables. The code for this usually looks as follows:

int c;


There doesn't appear to be anything wrong with this, but it does make use of a third variable and this takes up more memory.
Downloading of this magazine article is reserved for registered users only.
Login | Register now!
Loading comments...