modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / lib / uthash / libut / tests / test16.c
bloba7d7e7e6a42551846bafa3b96872c4ce2ef9d819
1 #include <stdio.h>
2 #include "utvector.h"
4 int main() {
5 int i,*p=NULL;
6 UT_vector v,*k;
7 utvector_init(&v, utmm_int);
8 for(i=0; i<10; i++) utvector_push(&v, &i);
10 k = utvector_clone(&v);
11 while ( (p=(int*)utvector_next(k,p))) printf("%d\n",*p);
13 for(i=0; i<10; i++) {
14 p = (int*)utvector_elt(&v, i);
15 printf("elt %d: %d\n", i, *p);
18 /* expect null */
19 p = (int*)utvector_elt(&v, 11);
20 printf("p is %snull\n", p ? "not " : "");
22 utvector_fini(&v);
23 utvector_free(k);
24 return 0;