首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include <stdio.h> #include <string.h> struct computer { char CPU[10]; }; main( ) { struct computer pc1, p
有以下程序 #include <stdio.h> #include <string.h> struct computer { char CPU[10]; }; main( ) { struct computer pc1, p
admin
2021-06-15
28
问题
有以下程序
#include <stdio.h>
#include <string.h>
struct computer
{ char CPU[10]; };
main( )
{
struct computer pc1, pc2;
strcpy(pc1.CPU, "3.2G");
strcpy(pc2.CPU, "????");
pc1 = pc2;
printf("%s\n", pc1.CPU);
}
程序运行后的输出结果是
选项
A、?
B、3.2G
C、????
D、?.2G
答案
C
解析
二个类型相同的结构体,可以使用一个给另一个初始化,使它们相等。前提是右值结构体变量所有成员全部初始化了。pc1=pc2,pc2的成员值和pc1中对应的成员相等。因此pc1.CPU输出????。答案为C选项。
转载请注明原文地址:https://jikaoti.com/ti/3Lz0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
人员的记录由编号和出生年、月、日组成,N名人员的数据已在主函数中存入结构体数组std中。函数fun的功能是:找出指定出生年份的人员,将其数据放在形参k所指的数组中,由主函数输出,同时由函数值返回满足指定条件的人数。请在程序的下划线处填入正确的内容并把下划
给定程序MODI1.C中函数fun的功能是:将长整型数s中每一位上为偶数的数依次取出,构成一个新数放在t中。高位仍在高位,低位仍在低位。例如,当S中的数为:87653142时,t中的数为:8642。请改正程序中的错误,使它能得出正确的结果。注意:不要
若已定义:inta[]={0,1,2,3,4,5,6,7,8,9},*p=a,i;其中0≤i≤9,则对a数组元素不正确的引用是()。
请编写函数fun,其功能是分别统计形参t所指二维数组中字母A和C的个数。注意:部分源程序存在PROG1.C中,请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。#inlclude<stdio.h>#inclu
以下不正确的定义语句是()。
下关于逻辑运算符两侧运算对象的叙述中正确的是( )。
以下语句中存在语法错误的是()。
设structSTR{charname[10];intage;charsex;}s[5],*ps;ps=&s[0];则以下scanf函数调用语句有错误的是()。
下列选项中,不是面向对象主要特征的是
以下选项中不合法的标识符是
随机试题
识别卡是非接触式IC卡的一种,它只能读,不能写。()
按照弗里德曼的货币需求函数,货币需求量同下列诸因素的关系正确的是()。
容量瓶和移液管不配套属于偶然误差。
简述企业通常采用的市场竞争战略。
A气血阴阳失调B气血阴阳亏虚,脏腑功能失调C气血阴阳亏虚,脏腑虚损D阴阳失调,营卫不和E脏腑功能失调内伤发热的基本病机为
下列不属于项目投融资管理方式的是()
下图中△ABC和△DEF是两个完全相同的等腰直角三角形,AB=9cm,EC=3cm,求阴影部分的面积()。
张某死后,遗产包括1张100元的存折,1台电视机和一些旧家具。张甲、张乙、张丙是张某的三个儿子。因无遗嘱,故三人经协商后,张甲继承了存折,张乙继承了电视,张丙继承了旧家具,一段时间后,王某向张乙出示了自己将电视借给张某的借条,张乙将电视还给王某。据此,下列
Hereissomeadviceonfoodshopping.The【C1】______familyspendsaboutone-sixthofitsincome【C2】______food.Becausefoodisex
论工作流管理技术在CIM系统协作中的应用计算机集成制造(ComputerIntegrationManufacturing,CIM)是信息技术和生产技术的综合应用,旨在提高制造业企业的生产率和响应能力。企业面临的任务是:将企业先后建立的多个分立
最新回复
(
0
)