有关C的简单问题
# include "stdio.h"void sub1(char a,char b)
{ char c; c=a; a=b; b=c; }
void sub2(char *a,char b)
{ char c; c=*a; *a=b; b=c; }
void sub3(char *a,char *b)
{ char c; c=*a; *a=*b; *b=c; }
void main()
{ char a,b; a='A'; b='B';
sub3(&a,&b); putchar(a); putchar(b);
sub2(&a,b); putchar(a); putchar(b);
sub1(a,b); putchar(a); putchar(b);
} 答案为什么会是BAAAAA