我有以下情况。我的目标是使 a 和 b 都指向相同的内存。但条件是它们都是指针。我该怎么做?
struct myStruct
{
struct anotherStruct* anoStrct;
};
main()
{
struct myStruct *a=( struct myStruct*)malloc(sizeof( struct myStruct));
struct myStruct *b=( struct myStruct*)malloc(sizeof( struct myStruct));
a=b;
}