首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include<stdio.h> struct STU{char name[9];char sex;int score[2];}; void f(struct STU a[]) {struct STU b={"zhao",’m’,85,90}
有以下程序 #include<stdio.h> struct STU{char name[9];char sex;int score[2];}; void f(struct STU a[]) {struct STU b={"zhao",’m’,85,90}
admin
2016-12-18
11
问题
有以下程序
#include<stdio.h>
struct STU{char name[9];char sex;int score[2];};
void f(struct STU a[])
{struct STU b={"zhao",’m’,85,90};
a[1]=b;}
main()
{struct STU c[2]={{"Qian",f,95,92},{"Sun",’m’,98,99}};
f(c);
printf("%s,%c,%d,%d,",c[0].name,c[0].sex,c[0].sc
选项
A、Qian,f,95,92,Sun,m,98,99
B、Zhao,m,85,90,Sun,m,98,99
C、Qian,f,95,92,Zhao,m,85,90
D、Zhao,m,85,90,Qian,f,95,92
答案
C
解析
在主函数中,定义了结构体STU数组c[2],并对其赋初始值。执行f(c)时,在函数f()中,把结构体变量b的值赋给了c[1]。
转载请注明原文地址:https://kaotiyun.com/show/BADp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
设变量已正确定义,则以下能正确计算n!的程序段是______。
下列程序的运行结果是______。#include<stdio.h>func(a,b){staticintm=0,i=2;i+=m+1;m=i+a+b;return(m);}main(
为了避免在嵌套的条件语句ifelse中产生二义性,C语言规定,else子句总是与()配对。
若要求从键盘读入含有空格字符的字符串,应使用函数
有以下定义:inta;longb;doublex,y;则以下选项中正确的表达式是()。
数据结构分为线性结构和非线性结构,线性表、栈和队列都属于【】。
对长度为n的线性表排序,在最坏情况下,比较次数不是n(n-1)/2的排序方法是
为了使模块尽可能独立,要求
若要求从键盘读入含有空格字符的字符串,应使用函数
数据库系统的核心是
随机试题
马克思说,资本主义“不自觉地为一个更高级的生产形式创造物质条件”,它的“历史任务和存在理由”是()
对于皮层诱发电位的描述,恰当的是
目前公认的术后放疗的作用为
患儿,5岁。因出生时颅脑产伤发生多次癫痫大发作,近2天因发作频繁,发作间隙持续昏迷而入院。诊断为癫痫持续状态。首选的治疗药物是
关于域名的说法,下列正确的是()。
CPA为甲公司进行2013年度财务报表审计,以下工作正确的有()。Ⅰ.甲公司80%的产成品存放于各地销售处,为证实该部分存货的存在,以积极的方式向所有销售处实施100%函证Ⅱ.CPA以预计回函无效为由未对与债务人发生纠纷存在争议
根据公文写作要求,分条列项指出下面公文文稿存在的错漏,并简述理由。
某工厂男女职工比例原为19:12,后来新加人一些女职工,使得男女比例变为20:13,后来又加入了若干男职工,此时男女比例变为30:19。若最终加人的男职工比女职工多3人,那么最终工厂有多少人?
发展经济和保护环境,关系到人类的前途和命运,成为全球普遍关注、亟待解决的重大问题。西方工业社会_________了二战以来经济和社会迅猛发展的人间喜剧,_________了科技革命给人类带来的空前无限的风光,但也亲身体验了环境破坏所带来的生态危机的切肤之痛
Whatdoesthewomantrytodointheconversation?
最新回复
(
0
)