diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2020-12-01 13:33:34 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2020-12-01 13:33:34 +0100 |
commit | 00e5132a803f8781b6f538625ab99816b7b52d2d (patch) | |
tree | 726a07ea8b2b6f35135dd253ecd8dc0768b09f42 /dependencies/uthash/tests/test50.c | |
parent | 32b192df3b898b4199325309a6113ae7efa3556e (diff) | |
parent | c8bf38e5fb717d40635a2a89b22ed71b0de4266b (diff) |
Merge commit 'c8bf38e5fb717d40635a2a89b22ed71b0de4266b' as 'dependencies/uthash'
Diffstat (limited to 'dependencies/uthash/tests/test50.c')
-rw-r--r-- | dependencies/uthash/tests/test50.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dependencies/uthash/tests/test50.c b/dependencies/uthash/tests/test50.c new file mode 100644 index 000000000..82e6be59d --- /dev/null +++ b/dependencies/uthash/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; +} |