结构指针
#include"stdio.h"struct date{
int year;
int month;
int day;
}today,*p;
int main()
{
today=(struct date){.year=2020,.month=03,.day=15};
p=&today;
printf("%p\n",p);
printf("%d",*p);
return 0;
}
为什么*p输出一个奇怪的数字?
int main() { today=(struct date) { .year=2020,.month=03,.day=15 }; p=&today; printf("%p\n",p); printf("%d,%d,%d",p->year,p->month,p->day); return 0; }