Duplicate.
See http://question.onlinegdb.com/7787/swap-two-strings-using-call-by-value-and-call-by-reference-in