当需要封装一些东西的时候,可以使用int类型的数据,将指针类型的数据封装起来,
typedef struct head
{
int a;
char b;
string c;
}love;
struct head *a;
int b = (int) a;
struct head *c=(struct *)b;
那么指针c和指针a指向的是相同的地方。
当需要封装一些东西的时候,可以使用int类型的数据,将指针类型的数据封装起来,
typedef struct head
{
int a;
char b;
string c;
}love;
struct head *a;
int b = (int) a;
struct head *c=(struct *)b;
那么指针c和指针a指向的是相同的地方。