Hi, this is the code that I have to swap two strings-
void swap(char *,char *);
main()
{
char *x="new";
char *y="word";
char *t;
swap(x,y);
printf("(%s,%s)",x,y);
}
void swap(char *x,char *y)
{
char *t;
t=x;
x=y;
y=x;
}
output- (new,word)
Why is the swap function not swapping the strings once the control comes out of swap? I am passing it using pointers (by reference).