//方法1:可以给p分配一段内存空间,并使其指向此空间:
#include<stdio.h>
main(){
struct abc{
int a;};
struct abc *p;
p=(struct abc *)malloc(sizeof(struct abc));
p->a = 1;
printf("%d\n",p->a);
}
//方法2:可以让p指向一个已存在的内存空间:#include<stdio.h>
main()
{
struct abc{
int a;};
struct abc *p;struct abc temp;
p=&temp;
p->a = 1;printf("%d\n",p->a);}