diff -r b79405fbf91d -r 608cc0b25352 docs/Writerside/topics/string.h.md --- a/docs/Writerside/topics/string.h.md Wed Dec 24 12:13:59 2025 +0100 +++ b/docs/Writerside/topics/string.h.md Thu Dec 25 11:10:13 2025 +0100 @@ -119,27 +119,24 @@ ```C #include -cxmutstr cx_strcat(size_t count, ... ); - -cxmutstr cx_strcat_a(const CxAllocator *alloc, size_t count, ... ); +int cx_strcat(cxmutstr *str, size_t count, ... ); -cxmutstr cx_strcat_m(cxmutstr str, size_t count, ... ); - -cxmutstr cx_strcat_ma(const CxAllocator *alloc, - cxmutstr str, size_t count, ... ); +int cx_strcat_a(const CxAllocator *allocator, + cxmutstr *str, size_t count, ... ); size_t cx_strlen(size_t count, ...); ``` -The `cx_strcat_a()` function takes `count` UCX strings (`cxstring` or `cxmutstr`), -allocates memory for a concatenation of those strings _with a single allocation_, -and copies the contents of the strings to the new memory. +The `cx_strcat_a()` function takes `count` UCX strings (`cxstring` or `cxmutstr` - not pointers!), +allocates memory in `str` for a concatenation of those strings _with a single allocation_, +and appends the contents of the strings to `str`. `cx_strcat()` is equivalent, except that it uses the [default allocator](allocator.h.md#default-allocator). -The `cx_strcat_ma()` and `cx_strcat_m()` append the `count` strings to the specified string `str` and, -instead of allocating new memory, reallocate the existing memory in `str`. -If the pointer in `str` is `NULL`, there is no difference to `cx_strcat_a()`. -Note, that `count` always denotes the number of variadic arguments in _both_ variants. +Example usage: +```C +cxmutstr str = {0}; +cx_strcat(&str, 2, cx_str("Hello, "), cx_str("World!")); +``` The function `cx_strlen()` sums the length of the specified strings.