27,518
社区成员
发帖
与我相关
我的任务
分享 cJSON *root = NULL;
char* out = NULL;
root=cJSON_CreateObject();
if(NULL == root) printf("cJSON_CreateObject err\n");
cJSON_AddNumberToObject(root,"type", 2);
cJSON_AddNumberToObject(root,"errorCode", code);
cJSON_AddStringToObject(root, "str", "str");
out=cJSON_Print(root);
if( NULL == out) printf("cJSON_Print err");
cJSON_Delete(root);
sendToUart((unsigned char *)out, strlen(out));
printf("send : %s\n",out);
free(out);



和我的情况一摸一样,太难了
不知可否帮我在你的VS软件下运行下程序看看结果是否一致是0.
你好问题解决了吗?我也有这个问题,只不过打印出来的是0

我的值一直是0而且前面有空格
我的值一直是0而且前面有空格