diff options
Diffstat (limited to 'tests/test50.c')
-rw-r--r-- | tests/test50.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test50.c b/tests/test50.c new file mode 100644 index 000000000..82e6be59d --- /dev/null +++ b/tests/test50.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include "utarray.h" + +int main() +{ + UT_array *nums; + long l, *p; + UT_icd long_icd = {sizeof(long), NULL, NULL, NULL }; + utarray_new(nums, &long_icd); + + l=1; + utarray_push_back(nums, &l); + l=2; + utarray_push_back(nums, &l); + + p=NULL; + while( (p=(long*)utarray_next(nums,p)) != NULL ) { + printf("%ld\n", *p); + } + + utarray_free(nums); + return 0; +} |