struct node { struct node *next; } a, b;
a.next = &b;
b.next = &a;
Создаём составной тип struct node, содержащий внутри себя указатель на struct node. #include
using namespace std;
int main()
{
void* fst = nullptr;
void* scd = (void*)&fst;
fst = (void*)&scd;
cout << hex << "First ptr addr = " << & fst << ", value = " << fst << endl;
cout << hex << "Second ptr addr = " << &scd << ", value = " << scd << endl;
return 0;
}
First ptr addr = 000000F56C0FF890, value = 000000F56C0FF898
Second ptr addr = 000000F56C0FF898, value = 000000F56C0FF890