有以下程序 struc t STU{ char name [10] int num; void f1(struct STU c) { struct STU b={"LiSiGuo",2042}; c=b; } void f2(struct STU *c) { struct STU b={"SunDan",2044); *c=b; } main ( ) { struct STU a={"YangSan",2041},b={"WangYin",2043}; f1 (a); f2 (b); printf ( "%d %d\n" ,a.num,b.num); } 执行后输出结果是A.2041 2044B.2041 2043C.2042 2044D.2042 2043
有以下程序 struc t STU{ char name [10] int num; void f1(struct STU c) { struct STU b={"LiSiGuo",2042}; c=b; } void f2(struct STU *c) { struct STU b={"SunDan",2044); *c=b; } main ( ) { struct STU a={"YangSan",2041},b={"WangYin",2043}; f1 (a); f2 (&b); printf ( "%d %d\n" ,a.num,b.num); } 执行后输出结果是
A.2041 2044
B.2041 2043
C.2042 2044
D.2042 2043
相关考题:
有以下程序includestruct STU{char name[10];int num;};void f(char*name, intnum){s 有以下程序 #include <string.h> struct STU { char name[10]; int num; }; void f(char *name, int num) { struct STU s[2]={{"SunDan",20044},{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() { struct STU s[2]={{"YangSan",20041},{"LiSiGuo",20042}},*p; p=s[1]; f(p->name,p->num); printf("%s %d\n",p->name,p->num); } 程序运行后的输出结果是A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041
有以下程序: include struct STU (char name[10]; int num; }; 有以下程序: #include <string.h> struct STU (char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{"SunDan",20044}.{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{"YangSall",20041},{"LiSiGao",20042}},*p;p=s[1]; f(p->name,p->num); printf("%s%d\n",p->name,p->num); } 程序运行后的输出结果是 ______。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041
有以下的结构体变量定义语句: struct student { int num; charname[9]; } stu; 则下列叙述中错误的是()。A.结构体类型名为stuB.num是结构体成员名C.struct是C的关键字D.结构体名为student
【单选题】以下结构体的定义语句中,正确的是______。A.struct student {intnum; char name[10];int age;};stu;B.struct {int num;char name[10];int age;}student; struct studentstu;C.struct student {int num; char name[10];int age;}stu;D.struct student {int num; char name[10]; int age;}; student stu;
有以下的结构体变量定义语句: struct student { int num; charname[9]; } stu; 则下列叙述中错误的是()。A.结构体类型名为stuB.num是结构体成员名C.struct是C的关键字D.结构体类型名为student
已知对学生记录的描述为: struct student { int num; char name[20],sex; struct{ int year,month,day; }birthday; } struct student stu; 设变量stu中的“生日”是“1995年11月12日”,对“birthday”正确赋值的程序是______。A.year=1995; month=11; day=12;B.stu.year=1995; stu.month=11; stu.day=12;C.birthday.year=1995; birthday.month=11; birthday.day=12;D.stu.birthday.year=1995; stu.birthday.month=11; stu.birthday.day=12;
已知对学生记录的描述为: struct student { int num; char name[20],sex; struct{ int year,month,day; }birthday; }; struct student stu; 设变量stu中的"生日"是"1995年11月12日",对"birthday"正确赋值的程序是______。A.year=1995;month=11;day=12;B.stu.year=1995;stu.month=11;stu.day=12;C.birthday.year=1995;birthday.month=11;birthday.day=12;D.stu.birthday.year=1995;stu.birthday.month=11;stu.birthday.day=12;
【单选题】已知对学生记录的描述为: struct student { int num; char name[20],sex; struct{ int year,month,day; }birthday; }; struct student stu; 设变量stu中的“生日”是“1995年11月12日”,对“birthday”正确赋值的程序是______。A.year=1995;month=11;day=12;B.stu.birthday.year=1995;stu.birthday.month=11;stu.birthday.day=12;C.birthday.year=1995;birthday.month=11;birthday.day=12;D.stu.year=1995;stu.month=11;stu.day=12;
以下结构体的定义语句中,正确的是______。A.struct student {int num; char name[10];int age;};stu;B.struct {int num; char name[10];int age;}student; struct student stu;C.struct student {int num; char name[10];int age;}stu;D.struct student {int num; char name[10]; int age;}; student stu;
已知对学生记录的描述为: struct student { int num; char name[20],sex; struct{ int year,month,day; }birthday; }; struct student stu; 设变量stu中的“生日”是“1995年11月12日”,对“birthday”正确赋值的程序是______。A.year=1995;month=11;day=12;B.stu.year=1995;stu.month=11;stu.day=12;C.birthday.year=1995;birthday.month=11;birthday.day=12;D.stu.birthday.year=1995;stu.birthday.month=11;stu.birthday.day=12;