题目内容 (请给出正确答案)
[主观题]

定义以下结构体数组,运行程序,程序输出结果是()。 #include <iostream> using namespace std; int main() { struct c { int x; int y; } s[2]={1,3,2,7}; cout<

B、6

C、14

D、21

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“定义以下结构体数组,运行程序,程序输出结果是()。 #inc…”相关的问题

第1题

关于结构体数组,以下说法正确的是()

A、结构体数组的数组元素是结构体类型

B、struct student information[100]; 该语句定义了information结构体数组,它的数据类型是student

C、在进行以下定义时,struct student 必须是已经定义的结构体数据类型 struct student information[100];

D、以下语句定义结构体数组,数组完整名称为struct student information。 struct student information[100];

点击查看答案

第2题

下面定义结构体数组的代码段正确的是()。

A、struct POINT{ public double x;//横坐标 public double y;//纵坐标 } POINT[] p; p=new POINT[100];

B、struct POINT{ public double x;//横坐标 public double y;//纵坐标 } POINT p[100];

C、struct POINT{ public double x;//横坐标 public double y;//纵坐标 } POINT p[]=new POINT[100];

D、struct POINT{ public double x;//横坐标 public double y;//纵坐标 } POINT p=new POINT[100];

点击查看答案

第3题

定义以下结构体数组 struct c { int x; int y; }s[2]={1,3,2,7} 语句printf(“%d”,s[0].x*s[1].x)的输出结果为( )。

A、14

B、6

C、2

D、21

点击查看答案

第4题

什么是结构体数组

点击查看答案

第5题

结构体数组可以作为一个整体,进行输入输出
点击查看答案

第6题

动态申请结构体数组空间和结构体数组复制
点击查看答案

第7题

有以下结构体说明、变量定义和赋值语句

struct STD

{ char name[10];

int age;

char sex;

} s[5],*ps;

ps=&s[0];

则以下 scanf 函数调用语句中错误引用结构体变量成员的是

A)scanf("%s",s[0].name);

B)scanf("%d",&s[0].age);

C)scanf("%c",&(ps->sex));

D)scanf("%d",ps->age);

点击查看答案

第8题

在程序中定义结构体类型变量,以下代码正确的是()。

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; /* 成绩 */ };

点击查看答案

第9题

有以下结构体说明和变量定义,如图所示,指针p、q、r分别...

有以下结构体说明和变量定义,如图所示,指针p、q、r分别指向一个链表中的三个连续结点。现要将q和r所指结点的先后位置交换,同时要保持链表的连续,以下错误的程序段是 struct node { int data; struct node *next; }*p, *q, *r;

A、r->next=q; q->next=r->next; p->next=r;

B、q->next=r->next; p->next=r; r->next=q;

C、p->next=r; q->next=r->next; r->next=q;

D、q->next=r->next; r->next=q; p->next=r;

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信