问题 单项选择题

有以下定义和语句
struct workers
int nnm;charname[20];charc;
struct
int day;int month;int year;s;

struct workers w,*pw;
pw=&w;
能给w中year成员赋1980的语句是()

A.*pw.year=1980;

B.year=1980;

C.pw->year=1980;

D.s.year=1980;

答案

参考答案:D

解析:

结构体structure workers中的成员s是结构体类型,给w中成员year赋值的语句是w.s.year=1980,故选D。

选择题
单项选择题