大学计算机编程语言C语言结构体指针使用方法训练试题及答案.docxVIP

  • 0
  • 0
  • 约3.88万字
  • 约 101页
  • 2026-11-30 发布于河南
  • 举报

大学计算机编程语言C语言结构体指针使用方法训练试题及答案.docx

大学计算机编程语言C语言结构体指针使用方法训练试题及答案

一、选择题(共60分)

1.在C语言中,以下哪个关键字用于定义结构体?

A.struct

B.structure

C.object

D.class

2.以下哪个是正确的结构体定义方式?

A.structstudent{charname[20];intage;};

B.structstudent{charname[20];intage;}

C.structstudent{charname[20];intage;};

D.structstudent{charname[20];intage;}student;

3.若有以下结构体定义:

```c

structPerson{

charname[20];

intage;

floatheight;

};

```

则sizeof(structPerson)的值是多少?(假设char为1字节,int为4字节,float为4字节)

A.28

B.29

C.30

D.32

4.以下哪个是正确的指向结构体的指针声明方式?

A.structptr

文档评论(0)

1亿VIP精品文档

相关文档