Implemented lz_sb_to_cstr

This commit is contained in:
cannoli-fruit 2026-07-19 20:43:28 -04:00
commit 5bb6ab1d1b
2 changed files with 24 additions and 0 deletions

16
examples/sb_to_cstr.c Normal file
View file

@ -0,0 +1,16 @@
#include <stdio.h>
#define LAZY_IMPL
#include "../lazy.h"
int main() {
Lz_SB x = lz_sb_from_cstr("Hello");
Lz_SB y = lz_sb_from_cstr(" World");
lz_da_concat(x, y);
lz_sb_add_char(&x, '\n');
char *s = lz_sb_to_cstr(&x);
printf("%s", s);
free(s);
return 0;
}