Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
735B

  1. #include <stdio.h>
  2. #include "utarray.h"
  3. int main()
  4. {
  5. UT_array *a;
  6. int i, *p=NULL;
  7. utarray_new(a, &ut_int_icd);
  8. for(i=0; i<10; i++) {
  9. utarray_push_back(a,&i);
  10. }
  11. utarray_pop_back(a);
  12. utarray_erase(a,0,1);
  13. while ( (p=(int*)utarray_next(a,p)) != NULL ) {
  14. printf("%d ",*p);
  15. }
  16. printf("\n");
  17. i = 100;
  18. utarray_insert(a,&i,3);
  19. while ( (p=(int*)utarray_next(a,p)) != NULL ) {
  20. printf("%d ",*p);
  21. }
  22. printf("\n");
  23. utarray_extend_back(a);
  24. p = (int*)utarray_back(a);
  25. *p = 1000;
  26. p = NULL;
  27. while ( (p=(int*)utarray_next(a,p)) != NULL ) {
  28. printf("%d ",*p);
  29. }
  30. printf("\n");
  31. utarray_clear(a);
  32. utarray_free(a);
  33. return 0;
  34. }