#include <stdio.h>
typedef struct { int age; char *name; } Student;
Student test(Student stu);
int main() { Student mystu = {20, "jack"};
Student newstu = test(mystu);
printf("%d-%s\n", newstu.age, newstu.name);
return 0; }
Student test(Student stu) { stu.age = 10; stu.name = "rose"; return stu; }
|