void f(int *a, int *b)
{
int t;
t = *a;
*a = *b;
*b = t;
}
int main()
{
int x = 3, y = 4;
f(&x, &y);
printf("%d,%d", x, y);
return 0;
}
***************************
#include <stdio.h>
void gg(char *s,char *p)
{
char m[20];
*m=*s;
*s=*p;
*p=*m;
printf("----\ns==%s\np==%s\n-----\n",s,p);
}
int main()
{
char s []= "hello c";
char p []= "hell world";
printf("s==%s\np==%s\n",s,p);
gg(s,p);
printf("s==%s\np==%s\n",s,p);
return 0;
}
怎样才能通过调用gg改变输出字符串 |