Singly-linked list/Element definition: Difference between revisions

Content added Content deleted
Line 1,349: Line 1,349:
}</lang>
}</lang>


=== Item at given index ===
=== Return nth item ===
Given a list index (an integer, starting from 1), the function return a pointer to the list item. If there are not enough elements, NULL is returned.
The function returns a pointer to the nth list item. If there are not enough elements, NULL is returned.


<lang stata>pointer(struct item scalar) scalar list_get(struct list scalar a,
<lang stata>pointer(struct item scalar) scalar list_get(struct list scalar a,