Updated README.md with dynstr_prepend example

This commit is contained in:
Xavier Del Campo Romero 2020-08-04 20:01:11 +02:00
parent fe3c74983c
commit 9bf483cde2
1 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@ int main(const int argc, const char *argv[])
dynstr_init(&s); dynstr_init(&s);
dynstr_append(&s, "Hello"); dynstr_append(&s, "Hello");
dynstr_append(&s, " from %s:%d\n", __func__, __LINE__); dynstr_append(&s, " from %s:%d\n", __func__, __LINE__);
dynstr_prepend(&s, "Hey! ");
printf("%s", s.str); printf("%s", s.str);
dynstr_free(&s); dynstr_free(&s);
@ -26,7 +27,7 @@ int main(const int argc, const char *argv[])
Output: Output:
``` ```
Hello from main:10 Hey! Hello from main:10
``` ```
# License # License
See LICENSE file. See LICENSE file.