#include <stdio.h> void swap(char*x,char *y) { char t; while (*x) { t=*x;*x=*y;*y=t; x++; y++; } } main() { char s1[]="abc",s2[]="123"; swap(s1,s2); printf("%s,%s\n",s1,s2); }