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
|