C Collections

cjson · Section 3

cjson_declare

cjson_declare - declare an uninitialized cjson variable

C Collections (libccollections, -lccollections)

#include <ccollections/cjson.h>
 
cjson_declare(var_name);

Expands to `cjson var_name`.  It exists so that cjson follows the
same naming convention as the other container modules.  You must
assign the variable before you use it, for example with the result
of cjson_parse() or of one of the cjson_create_*() functions.

var_name  Name of the variable to declare.

cjson_declare(root);
root = cjson_parse("{\"k\":1}", NULL);
cjson_destroy(root);

cjson_declare_scoped(3), cjson_destroy(3), cjson_parse(3)