modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / lib / uthash / libut / tests / test3.c
blobc69a3a1518f0b5a4c657d610c624d22f9e1ce3da
1 #include <stdio.h>
2 #include "utvector.h"
4 int main() {
5 int i,*p=NULL;
6 UT_vector v;
7 utvector_init(&v, utmm_int);
8 for(i=0; i<10; i++) utvector_push(&v, &i);
9 printf("len %d\n", utvector_len(&v));
10 utvector_pop(&v);
11 printf("len %d\n", utvector_len(&v));
12 p = (int*)utvector_extend(&v);
13 *p = 11;
15 p=NULL;
16 while ( (p=(int*)utvector_next(&v,p))) printf("%d\n",*p);
17 printf("len %d\n", utvector_len(&v));
19 utvector_clear(&v);
20 printf("len %d\n", utvector_len(&v));
22 utvector_fini(&v);
23 return 0;