0
circular data strcture
how can i make circular data structure using pointer. . .
1 Odpowiedź
+ 1
Do you mean a ring-like structure? You can use a linked list.
struct smthing {
/* int x; const char *id; etc */
smthing *next;
} ;
now you manage the individual elements of the linked list. Have the last element point to head:
llist->next = &head;
Be aware that you have to manage your memory manually with new and free.