第30950题 单选题
以下关于C++结构体的语法使用,正确的是哪一项?
A

以下结构体定义是合法的:<br>cpp<br>struct Student {<br> int id;<br> char name[20];<br>}<br>

B

若有定义struct Student { int id; }; Student s;,则s->id = 1001;是合法的成员赋值语句

C

若有定义struct Student { int id; int age; };,则Student s = {1001, 18};是合法的结构体初始化语句

D

结构体的成员不能是其他已定义的结构体类型,只能是基本数据类型

程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析