Did you know that you can use the XOR operator to swap the values in 2 variables without the use of a 3rd variable?
Check it out:
int x = 111;int y = 3333;
x ^= y;y ^= x;x ^= y;
x.Dump();y.Dump();
Outputs:
3333111
Remember, if you want me to respond to your comment, then you need to use a Google/OpenID account to leave the comment.
No comments:
Post a Comment
Remember, if you want me to respond to your comment, then you need to use a Google/OpenID account to leave the comment.