有以下程序
#include
#include
struct A
{
int a;
char b[10];
double c;
};
struct A f(struct A t);
main()
{
struct A a={1001,"ZhangDa",1098.0};
a=f(a);
printf("%d,%s,%6.1f\n",a.a,a.b,a.c);
}
struct A f(struct A t)
{
t.a=1002;
strcpy(t.b,"ChangRong");
t.c=1202.0;
return t;
}
程序运行后的输出结果是
- A.1002,ZhangDa,1202.0
- B.1002,ChangRong,1202.0
- C.1001,ChangRong,1098.0
- D.1001,ZhangDa,1098.0
热度🔥796
解析:打开微信小程序查看本题解析