Is there any built in swap function in C which works without using a third variable?
Why do you not want to use a third variable? It's the fastest way on the vast majority of architectures.
The XOR swap algorithm works without a third variable, but it is problematic in two ways:
swap(&a, &a)
will not work.It may sometimes be preferable to use the XOR swap if using a third variable would cause the stack to spill, but generally you aren't in such a position to make that call.
To answer your question directly, no there is no swap function in standard C, although it would be trivial to write.