A.类是一种用户自定义的数据类型
B.只有类中的成员函数才能存取类中的私有成员
C.在类中,如果不做特别说明,所指的数据均为私有类型
D.在类中,如果不做特别说明,所有的成员函数均为公有类型
A、struct student { int num; char name[20]; char sex; int score; } student1,student2;
B、struct { int num; char name[20]; char sex; int score; }student1, student2;
C、struct student { int num; /* 学号 */ char name[20]; /* 姓名 */ char sex; /* 性别 */ int score; /* 成绩 */ }; ...... struct student student1, student2;
D、struct student student1, student2; ...... struct student { int num; /* 学号 */ char name[20]; /* 姓名 */ char sex; /* 性别 */ int score; /* 成绩 */ };
A、struct student { long no; double score; };
B、struct stud[20] { long no; double score; };
C、struct student { long no; double score; }stud[20];
D、struct { long no; double score; } stud[100];
A、结构体类型所占内存的字节数就是结构体的每个成员类型所占内存字节数的总和。
B、结构体在内存中所占的字节数不仅与所定义的结构体类型有关,还与计算机系统本身有关。
C、计算结构体所占内存的字节数时,一定要使用sizeof运算符。
D、内存对齐的主要目的就是为了提高内存的寻址效率。不同的系统和编译器,内存对齐方式可能会不同,是机器相关的。
A、对结构体变量的成员的访问是通过名字并使用成员选择运算符来访问的。
B、只能在相同类型的结构体变量之间进行赋值。
C、可以使用==和!=来判定两个结构体相等或不等。
D、对嵌套的结构体成员,必须以级联的方式来访问。
A、stu1. birthday. year = 1999;
B、(*pt). birthday. year = 1999;
C、pt -> birthday -> year = 1999;
D、pt -> birthday. year = 1999;
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!