[Top] [Prev] [Next] [Bottom] [Contents]

SutSizList

Returns the number of elements in a SutList.

Synopsis

#include "SutList.h"
int SutSizList(pSutList p);

Arguments

p
A pSutList.

Return Values

Returns the number of elements in a SutList. Returns -1 if passed a NULL value.

Description

SutSizList returns the number of elements in a SutList. The SutList structure and related functions manage a dynamically sized array of void pointers which can be used as a generic container for C/C++ programmers.

Example

#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);

See Also



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.