69,368
社区成员
发帖
与我相关
我的任务
分享
typedef struct
{
int a;
char b;
}STU;
STU fun(STU *p)
{
return *p;
}
int main()
{
STU a = {1,2}, b;
b = fun(&a);
printf("%d\t%d", b.a, b.b);
return 0;
}
struct s{
int x;
int y;
int z;
};
struct s func()
{
struct s y;
y.x=1;
y.y=2;
y.z=3;
return y;
}
#include<stdio.h>
int main()
{
struct s x = func();
printf("%d,%d,%d\n",x.x,x.y,x.z);
return 0;
}