cstring · Section 3
cstr_construct
NAME
cstr_construct - declare and initialise a cstr in one step
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cstring.h> cstr_construct(s, initial);
DESCRIPTION
This macro does cstr_declare() and cstr_init() in one statement. It creates a new cstr variable named s and initialises it with the content you give.
PARAMETERS
s Variable name to create initial Initial content (C string or NULL for empty string)
EXAMPLES
cstr_construct(greeting, "Hello"); cstr_append(greeting, ", world!"); cstr_destroy(greeting);
SEE ALSO
cstr_construct_scoped(3), cstr_construct_mp(3), cstr_declare(3), cstr_init(3)