指针变量的三种表现形式

来源:互联网 发布:pr软件 编辑:程序博客网 时间:2024/05/16 12:41
<pre name="code" class="cpp">struct student{     int num;     char name[20];     char sex;     float score;};//     结构指针变量(3种形式)     struct student student1={1,"jereh",'M',89};     struct student *p;     p=&student1;     printf("name为:%s\n",student1.name);//     printf("name为:%s\n",(*p).name);//     printf("name为:%s\n",p->name);



0 0
原创粉丝点击