C Collections

cstring · Section 3

cstring_create

cstring_create - create a string with default memory management

C Collections (libccollections, -lccollections)

#include <ccollections/cstring.h>
 
cstr cstring_create(const char *initial, char **err);

This is cstring_create_full() with the default malloc/free allocators.

initial   Initial C string content, or NULL for an empty string
err       Optional pointer to receive an error string on failure

A pointer to the new cstring on success
NULL on failure, with the details written to *err when err is not NULL

The call is the same as cstring_create_full(initial, NULL, err)

cstring_create_full(3), cstring_new(3), cstring_destroy(3)