struct{int x;char pstr[16];}test = { 66,"have a try" }, *ptest = &test;以下关于结构体成员访问描述正确的是_____
A. 执行 printf("%s\n", ptest.pstr); 后输出"have a try"
B. 执行 printf("%c\n", ++*ptest->pstr); 后输出'i'
C. 执行 printf("%c\n", (*ptest->pstr)++); 后输出'i'
D. 执行 printf("%c\n", *++ptest->pstr); 后输出'v'
查看答案
struct point{int x;int y;}pts[]={1,3,5,7}, *ptr;ptr=pts;以下关于结构体成员访问的描述错误的是_____
A. printf("%d\n", ptr->x); 输出1
B. printf("%d\n", *ptr.y); 输出3
C. printf("%d\n", (*(++ptr)).x); 输出5
D. printf("%d\n", (++ptr)->y); 输出7
以下关于结构体类型及变量的声明正确的是_____
A. struct student{char name[16];int age}stu1;
B. struct student{int age, rank}stu1;
C. struct student{char name[16];int age;float score;};student stu1;
D. struct student{char name[16];int age, rank;float score;};struct student student;
struct student{char name[16];int age;};以下关于结构体变量的初始化描述错误的是_____
A. struct student stu1={"john"; 18};
B. struct student stu1={"xiaoming", 19};struct sutdent stu2=stu1;
C. struct student stu1={"john"};
D. int age=19;struct student stu1={"john", age};
#includestruct book{char name[32]; //书名float price; //定价char publisher[32]; //出版社};以下关于结构体的使用正确的是_____
A. struct book math;math.name="The C Programming Language";math.price =39.9;math.publisher="China Machine Press";
B. struct book prog={"The C Programming Language", 69.9, "China Machine Press"};printf("%s, %f, %s\n", prog);//输出教材名称、定价和出版社
C. struct book prog;scanf("%s%f%s\n", &prog);//输入教材名称、定价和出版社
D. struct course{char name[32]; //课程名称int csHour; //课时char speciality[16]; //专业struct book textbook; //教材} thecprogramming;