#define SB_IMPLEMENTATION
#include "sb.h"
string_builder sb = {0};
sb_init(&sb);
sb_write(&sb, "Hello, ");
sb_writef(&sb, "%s%c", "World", '!');
puts(sb.buf); // Prints "Hello, World!"
// The buffer can also be returned as an allocated string:
char *s = sb_to_string(&sb);
puts(s);
free(s); // The caller is responsible for freeing it.
sb_deinit(&sb);