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.

30 lines
829B

  1. #include <stdio.h> /* printf */
  2. #include "utstring.h"
  3. int main()
  4. {
  5. UT_string *s,*t;
  6. char a[] = " text";
  7. utstring_new(s);
  8. utstring_new(t);
  9. utstring_printf(s,"hello %s", "world");
  10. printf("%s\n", utstring_body(s));
  11. utstring_bincpy(s,a,sizeof(a)-1);
  12. printf("%s\n", utstring_body(s));
  13. utstring_printf(t," second");
  14. printf("%s\n", utstring_body(t));
  15. utstring_concat(s,t);
  16. printf("%s\n", utstring_body(s));
  17. utstring_clear(t);
  18. printf("cleared, length t now: %u\n", (unsigned)utstring_len(t));
  19. printf("length s now: %u\n", (unsigned)utstring_len(s));
  20. utstring_printf(t,"one %d two %u three %s", 1, 2, "(3)");
  21. printf("%s\n", utstring_body(t));
  22. printf("length t now: %u\n", (unsigned)utstring_len(t));
  23. utstring_free(t);
  24. utstring_free(s);
  25. return 0;
  26. }