I have a strange linked list (code is not mine):
struct _P_NEXT
{ P_NEXT* p_el; };
As you can see, there is no data field. However, the list must contain complex structures. For illustration, I give a method of adding an item to the end of the list:
void in_tail(P_NEXT* head_list, P_NEXT* el_list) {
el_list->p_el = NULL;
P_NEXT* el;
el = head_list->p_el;
if (el) {
while (el->p_el)
el = el->p_el;
(el->p_el) = el_list;
}
else {
head_list->p_el = el_list;
}
}