这样就可以啦
#include<stdio.h>
void s(char *x,char *y)
{
char t;
t=*x;
*x=*y;
*y=t;
}
void main()
{
char p1[] = "abc", p2[] = "123";
char *s1 =p1, *s2 = p2;
s(s1,s2);
//printf("%c %c\n",*s1,*s2);
printf("%s %s\n",s1,s2);
}
#include<stdio.h>
void s(char *x,char *y)
{
char t;
t=*x;
*x=*y;
*y=t;
}
void main()
{
char p1[] = "abc", p2[] = "123";
char *s1 =p1, *s2 = p2;
s(s1,s2);
//printf("%c %c\n",*s1,*s2);
printf("%s %s\n",s1,s2);
}