C Collections

cstring · Section 3

cstr_destroy

cstr_destroy - destroy a cstr and set it to NULL

C Collections (libccollections, -lccollections)

#include <ccollections/cstring.h>
 
cstr_destroy(s);

This macro is the type-inferred form of cstring_destroy(). It destroys
the string and then sets the pointer to NULL.

s   cstr lvalue to destroy, such as a variable or an element of an
    array; the macro evaluates it exactly once and sets it to NULL

Calling it with a NULL pointer is safe and does nothing

cstring_destroy(3)