vendredi 31 juillet 2015

Why does this swap operation work in C?

To swap to integers, A and B, this seems to work in C,

A = A + B - ( B = A);

Why does this work? And if this works in all conditions, can this be used to shorten any other commonly implemented algorithms?

Aucun commentaire:

Enregistrer un commentaire