这个结构体后面写st1以及后面的大括号里的值是怎么回事,干什么用的。求大神~~~
structstudent{longintnum;structbirthbirthday;char*name;}st1={200,{1988,8,8},"zhangsan...
struct student
{
long int num;
struct birth birthday;
char* name;
}st1={200,{1988,8,8},"zhangsan"};
这里是逐个赋初值吗?还有那个st3=st2是干嘛的,怎么用的?输出时候printf就是要按这种格式写吗?谢谢谢谢,初学acm各种不懂
printf(" NO. age name /n");
printf(" %ld %d %s/n",st1.num,st1.age,st1.name);
getch();
st2.num=199;
st2.age=19;
st2.name="lisi";
printf(" %ld %d %s/n",st2.num,st2.age,st2.name);
st3=st2; 展开
{
long int num;
struct birth birthday;
char* name;
}st1={200,{1988,8,8},"zhangsan"};
这里是逐个赋初值吗?还有那个st3=st2是干嘛的,怎么用的?输出时候printf就是要按这种格式写吗?谢谢谢谢,初学acm各种不懂
printf(" NO. age name /n");
printf(" %ld %d %s/n",st1.num,st1.age,st1.name);
getch();
st2.num=199;
st2.age=19;
st2.name="lisi";
printf(" %ld %d %s/n",st2.num,st2.age,st2.name);
st3=st2; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询