Implemented lz_sb_to_cstr
This commit is contained in:
parent
0f5e03632e
commit
5bb6ab1d1b
2 changed files with 24 additions and 0 deletions
16
examples/sb_to_cstr.c
Normal file
16
examples/sb_to_cstr.c
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue