libstr-c

C string library
git clone https://git.sinitax.com/sinitax/libstr-c
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

test.c (326B)


      1#include "str.h"
      2#include "allocator.h"
      3
      4#include <stdio.h>
      5
      6const struct allocator *ga = &stdlib_strict_heap_allocator;
      7
      8int
      9main(int argc, const char **argv)
     10{
     11	char *str;
     12
     13	str = NULL;
     14	str = str_app(ga, NULL, str, "Something");
     15	str = str_app(ga, NULL, str, " -- and more!");
     16
     17	printf("%s\n", str);
     18
     19	ga->free(ga, str);
     20}