提交 cb1df2f8 编写于 作者: M Max Bruckner

README: Add note about needing to free print results in examples

上级 2c914c07
......@@ -298,6 +298,7 @@ In this example we want to build and parse the following JSON:
Let's build the above JSON and print it to a string:
```c
//create a monitor with a list of supported resolutions
//NOTE: Returns a heap allocated string, you are required to free it after use.
char* create_monitor(void)
{
const unsigned int resolution_numbers[3][2] = {
......@@ -373,6 +374,7 @@ end:
Alternatively we can use the `cJSON_Add...ToObject` helper functions to make our lifes a little easier:
```c
//NOTE: Returns a heap allocated string, you are required to free it after use.
char *create_monitor_with_helpers(void)
{
const unsigned int resolution_numbers[3][2] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册