【单选题】若有以下定义和语句 struct student { int age; int num;}; struct student stu[3]={{1001,20},{1002,19},{1003,21}}; int main() {struct student *p; p=stu;……} 则以下不正确的引用是()。
A.(p++)->num
B.p++
C.(*p).num
D.p=&stu.ag
数据结构里,struct student { char name[20]; char sex[10]; int age; int score; }; 定义结构体后,定义变量、数组赋值正确的是()。A、struct student s={"张三","男",18,100};B、struct student stu[3]={{"张三","男",18,100},{"李四","男",19,90},{"王五","男",23,97}};C、struct student s={"李四";"女";18;100};D、struct student stu[3]={{"张三",18,"男",100},{"李四",19,"男",90},{"王五",23,"男",97}};
点击查看答案
有以下说明语句:struct Student{int num;double score;};Student stu[3]={{1001,80},{1002,75},{1003,91}},*p=stu;则下面引用形式错误的是()A、p->numB、(p++).numC、(p++)->numD、(*p).num
单选题若有以下说明和语句: struct student{ int age; int num; }std, *p; p=&std; 则下面对该结构体变量std中成员age的引用方式错误的是()。A std.ageB *p.ageC (*p).ageD p->age
单选题有以下说明语句:struct Student{int num;double score;};Student stu[3]={{1001,80},{1002,75},{1003,91}},*p=stu;则下面引用形式错误的是()A p->numB (p++).numC (p++)->numD (*p).num
单选题有以下函数:#include struct stu{ int num; char name[10]; int age;};void fun(struct stu *p){ printf(%s, p->name);}main(){ struct stu x[3] = {{01,Zhang,20}, {02,Wang,19}, {03,Zhao,18}}; fun(x+2);}程序运行后的输出结果是( )。A ZhangB ZhaoC WangD 19
单选题以下scanf函数调用语句中对结构体变量成员的不正确引用的是()。 struct node{ char name[20]; int age; int sex; }student[5],*p; p=student;A scanf(“%s”,student[0].name);B scanf(“%d”,&student[0].age);C scanf(“%d”,&(p->sex));D scanf(“%d”,p->age);
单选题有下列语句: struct Birthday{public int year; public int month; public int day;}; struct Student{ int no; string name; int age; public Birthday bir; }; …… Student Stu; 如果要把Stu的出生年份赋值为1988,正确的语句是()AStu.bir.year=1988;BStu.year=1988;CStu. Birthday.year=1988;DStudent. Birthday.year=1988;