[STM32F4] STM32和cJSON的问题?

[复制链接]
 楼主| zhouyou99 发表于 2025-7-24 02:04 | 显示全部楼层 |阅读模式
STM32和cJSON的问题?我在STM32F429ZI开发板上运行以下代码(项目使用STM32Cube 6.3生成,开发环境为Cube IDE 1.7):

// Create a json object
cJSON *info;
info=cJSON_CreateObject();
//adding data
cJSON_AddStringToObject(info,"sex","male");
cJSON_AddNumberToObject(info,"age",20);
cJSON_AddStringToObject(info,"name","weijun");
// character pointer
char *jsonStr;
But in the jsonStr only the first two string was added. See bellow:
Name : jsonStr
Details:0x20006e90 "{\n\t\"sex\":\t\"male\",\n\t\"age\":\t"
Default:0x20006e90 "{\n\t\"sex\":\t\"male\",\n\t\"age\":\t"
Decimal:536899216
Hex:0x20006e90
Binary:100000000000000110111010010000
Octal:04000067220

caigang13 发表于 2025-7-24 07:45 来自手机 | 显示全部楼层
具体什么问题?没说清楚啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则

37

主题

37

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部