#include<stdio.h>
void main()
{
struct student
{
int num;
char name[20];
};
struct student sss[10];
struct student *p=sss;
(*p).num=102;
printf("%d\n",p);
p=sss+1;
void main()
{
struct student
{
int num;
char name[20];
};
struct student sss[10];
struct student *p=sss;
(*p).num=102;
printf("%d\n",p);
p=sss+1;
printf("%d\n",p);//增加了24个字节
p=p+1;//增加了24个字节
p=sss[0]+1;//增加了24个字节
while(1);}
经试验,最终加24个字节,而不是在自身结构体加1字节,而是指向下一个结构体。