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;
以下关于结构体变量的描述错误的是_____
A. 结构体变量可以传递给一个有同类型形参的函数
B. 函数可以返回结构体类型的返回值
C. 结构体变量可以作为一个整体进行输入和输出
D. 一个已初始化的结构体变量可以给另一个同类型结构体变量赋值