首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设有以下程序段 struct MP3 {char name[20]; char color; floatprice; }std,*ptr; ptr=&std; 若要引用结构体变量std中的color成
设有以下程序段 struct MP3 {char name[20]; char color; floatprice; }std,*ptr; ptr=&std; 若要引用结构体变量std中的color成
admin
2012-05-23
48
问题
设有以下程序段
struct MP3
{char name[20];
char color;
floatprice;
}std,*ptr;
ptr=&std;
若要引用结构体变量std中的color成员,写法错误的是
选项
A、std.color
B、ptr->color
C、(*ptr).color
D、std->color
答案
D
解析
结构体变量的成员有3种引用形式,分别为:①结构体变量.成员名;②(*结构体指针变量).成员名;⑨结构体指针变量一>成员名。
转载请注明原文地址:https://kaotiyun.com/show/sNPp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序#definef(x)(x’x)main(){inti1,i2;i1=f(8)/f(4);i2=f(4+4)/f(2+2);printf("%d,
有以下程序:main(){char*p[10]={"abc","aabdfg","dcdbe","abbd","cd"};printf("%d\n",strten(p[4]));}
有以下程序main(){inta=15,b=21,m=0;switCh(a%3){case0:m++;break;case1:m++;switch
以下不正确的叙述是()。
一个C语言程序是由()。
以下程序运行后的输出结果是【】。structNODE{intk;structNODE*link;};main(){structNODEm[5],*p=m,*p=m,*q=m+4;inti=0;
以下程序运行后的输出结果是【】。intf(inta[],intn){if(n>=1)returnf(a,n-1)+a[n-1];elsereturn0;}main()
有以下程序#include<string.h>structSTU{inthum;floatTotalScore;};voidf(structSTUp)
以下程序段打开文件后,先利用fseek函数将文件位置指针定位在文件末尾,然后调用删函数返回当前文件位置指针的具体位置,从而确定文件长度,请填空。FILE*myf;longfl;myf=【】("test.t","rb");fs
随机试题
下面引起高钾血症的病因中哪项是不正确的
犬前列腺增生以后最好的治疗方法是()。
合同履行地点不明确的,交付不动产时,应在( )履行。
流动资金是指为维持生产所占用的全部周转资金,它是()。
最低工资率的确定实行()的代表民主协商的原则。
如何激发学生的学习动机?
Thegovernmentpoliciesprovidedanimpetustothisarea’sgrowth.
北洋政府时期,采用资产阶级三权分立宪法原则的宪法文件(草案)是()。
Periodicallyinhistory,therecomeperiodsofgreattransitioninwhichworkchangesitsmeaning.Therewasatime,perhaps10,
MostmarriedAmericanwomennowworkoutsidetheirhome.TheMoralesfamilyisabigfamilyWithfivemembers.
最新回复
(
0
)