#include "SutList.h"
pSutList SutNewList();
SutDeleteList()
or SutDestroyList()
. Caution is needed in using SutDestroyList to deallocate the elements. If the elements contain pointers to other heap items these will not be deallocated. If the elements are non-heap memory, a disaster will probably occur.
#include "SutList.h"
#include <stdio.h>
pSutList list;
int i, size;
char *str;
char* str1 = "Hello";
char* str2 = "World";
list = SutNewList();
SutAddList(list, str1);
SutAddList(list, str2);
size = SutSizList(list);
for (i=0; i<size; i++)
{
str = (char*) SutGetNList(list, i);
fprintf(stderr, "%s\n", str);
}
SutDeleteList(list);