有以下说明和定义语句:struct student{int age; char num[8] ;};struct student stu [3] = { { 2

题目

有以下说明和定义语句:struct student{int age; char num[8] ;};struct student stu [3] = { { 20, "200401" } , {21, "200402" } , {19, "200403" } };stract student * p = stu;以下选项中引用结构体变量成员的表达错误的是( )。

A.(p++) ->num

B.p- >num

C.( *p).num

D.stu[3].age

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

阅读下列XML文档,回答问题1至问题4,将解答填入对应栏内。

【XML文档】

<? Xml version= "1.0" encoding=" GB2312 "?>

<!—以下是文档的主体部分→

<college>

<title>希赛教育</title>

<head>软考培训部</Head>

<Stu_Num unit="人">2</Stu_Num>

<Student>

<Name>张网管</Name>

<Age>21 </Age>

<Sex>男</Sex>

<Class>软考2班</Class>

</Student>

<Student>

<Name>李软设</Name>

<Age>20</Age>

<Sex>女</Sex>

<Class>软考3班</Class>

</Student>

</College>

与HTML相比,XML具有哪些特点?


正确答案:与HTML相比XML主要有以下特点。 (1)XML是元标记语言。 (2)XML描述的是结构和语义。 (3)XML文档的显示使用特有的技术来支持。
与HTML相比,XML主要有以下特点。 (1)XML是元标记语言。 (2)XML描述的是结构和语义。 (3)XML文档的显示使用特有的技术来支持。

第2题:

【单选题】以下结构体的定义语句中,正确的是______。

A.struct student {intnum; char name[10];int age;};stu;

B.struct {int num;char name[10];int age;}student; struct studentstu;

C.struct student {int num; char name[10];int age;}stu;

D.struct student {int num; char name[10]; int age;}; student stu;


struct student {int nmu; char name[10]; int age;} stu;

第3题:

已知Student类是一个空类,stu1和stu2是Student类的两个对象,则通过“stu1.name='李晓明'”语句增加的属性可以通过()访问。

A.Student.name、stu1.name或stu2.name

B.Student.name或stu1.name

C.stu1.name或stu2.name

D.stu1.name


参考答案:D

第4题:

以下结构体的定义语句中,正确的是______。

A.struct student {int num; char name[10];int age;};stu;

B.struct {int num; char name[10];int age;}student; struct student stu;

C.struct student {int num; char name[10];int age;}stu;

D.struct student {int num; char name[10]; int age;}; student stu;


struct student {int nmu; char name[10]; int age;} stu;

第5题:

有以下的结构体变量定义语句: struct student { int num; charname[9]; } stu; 则下列叙述中错误的是()。

A.结构体类型名为stu

B.num是结构体成员名

C.struct是C的关键字

D.结构体类型名为student


B

第6题:

有以下的结构体变量定义语句: struct student { int num; charname[9]; } stu; 则下列叙述中错误的是()。

A.结构体类型名为stu

B.num是结构体成员名

C.struct是C的关键字

D.结构体名为student


B

第7题:

2、以下对结构变量stul中成员age的正确引用是()。 struct student { int age; int num; }stu1;

A.stu1.age

B.student.age

C.age

D.struct student.age


A

第8题:

struct{int num;float scor;}student;struct student std1;是对结构体类型的变量student的定义。()

此题为判断题(对,错)。


参考答案:错误

第9题:

以下()定义不会分配实际的存储空间。

A.struct { char name[10] ; int age ; } student ;

B.struct STUDENT { char name[10] ; int age ; } student ;

C.struct STUDENT { char name[10] ; int age ; } ; struct STUDENT student;

D.struct STUDENT { char name[10] ; int age ; } ;


struct STUDENT { char name[10] ; int age ; } ;

第10题:

2、以下哪个定义不会分配实际的存储空间?

A.struct { char name[10] ; int age ; } student ;

B.struct STUDENT { char name[10] ; int age ; } student ;

C.struct STUDENT { char name[10] ; int age ; } ; struct STUDENT student;

D.struct STUDENT { char name[10] ; int age ; } ;


struct STUDENT { char name[10] ; int age ; } ;