函数不能传多个参数。但是我学了结构体之后,有个想法就是,在参数里写上结构体。这样不就能传多个值了吗!
#include<stdlib.h> #include<stdio.h> #include<conio.h> #include<string.h> struct s { int a; char b; }c;
void bian(struct s h)
{
h.a=1;
h.b='k';
}
int main()
{
bian(c);
printf("得出的值分别为:%d %d",c.a,c.b);
getch();
return 0;
}
但是呢?结构体里两个结果都得0。无限懵逼,求解答