直接上代码
struct People{
int age;
}
int main(){
struct People * p= malloc(sizeof(struct Perople));
p->age=10;
struct People * p1=p;
p-age=12;
printf("%d\n",p1->age);
free(p);
return 0;
}
}
函数指针:
typedef 关键字
可以省掉很多重复的声明
直接上代码
struct People{
int age;
}
int main(){
struct People * p= malloc(sizeof(struct Perople));
p->age=10;
struct People * p1=p;
p-age=12;
printf("%d\n",p1->age);
free(p);
return 0;
}
}
函数指针:
typedef 关键字
可以省掉很多重复的声明
转载于:https://my.oschina.net/bquan/blog/291304