As Griff said: Don't do such games in regular code! They are hard to read and maintain. And your example only works by chance and is compiler dependent.
Just for the fun of solving the puzzle: Here is a version that does work and fits in a single line of C-code:
a = a^b, b=a^b, a=a^b;
That is not compiler dependent. But still nobody would normally guess what this line is supposed to do. So, I would never use that little "trick" in production code, but use a temporary variable instead. That by the way might also be slightly faster in many cases as the compiler will most likely put the temporary in a register and then use three simple register copies instead of XORs. (I have never done timings on that, though. It isn't worth the effort.)
In C++ you would of course simply use
std::swap (a, b);