某学生的记录描述如下,能将其正确定义并将变量中的“出生日期”赋值为1984年11月11日的是
A.
struct student
{
int number;
char name[20];
char sex;
} s;
struct
{
int year;
int month;
int day;
} birth;
birth.year = 1984;
birth.month = 11;
birth.day = 11;
B.
struct student
{
int number;
char name[20];
char sex;
int year;
int month;
int day;
} s;
year = 1984;
month = 11;
day = 11;
C.
struct student
{
int number;
char name[20];
char sex;
struct
{
int year;
int month;
int day;
} birth;
} s;
s.birth.year = 1984;
s.birth.month = 11;
s.birth.day = 11;
我感觉这四种方式好像都对啊!到底应该怎么赋值?求大神挨个帮我解析一下
再问一下大神:结构体和共用体都不能进行比较操作吗?