Lists Class Help
- Updated2023-02-21
- 1 minute(s) read
Lists Class Help
This class provides functions for a list data type.
A list is an ordered sequence of items of the same size. Lists are very useful for managing arrays of data when the size of the arrays cannot be known ahead of time.
![]() |
Note The lists managed by this class of functions are lists of arbitrary data items. They are not related to the User Interface Library functions that operate on list boxes and ring controls. |
The following example uses the list data type:
#include "toolbox.h"
static ListType list;
static double value;
static int index;
list = ListCreate(sizeof(double));
for (index = 1; index <= 360; index++) {
value = sin (PI * index / 180);
ListInsertItem (list, &value, END_OF_LIST);
}
YGraphPopup ("Plot Of Data In List", ListGetDataPtr(list),
ListNumItems(list), VAL_DOUBLE);
Lists are very general data structures that can be used to implement other data structures:
Stacks – Always insert and delete from the end of the list.
Queues – Insert at the front, delete from the end.
N–ary Trees – Make each list item a structure node that includes a list of child structure nodes.
Library: Programmer's Toolbox Control