这里我采用的是cjson 添加头文件 #include "cJSON.h" 解析并输出: char *result = rec_result; cJSON *json = cJSON_Parse(result); int rc = cJSON_GetObjectItem(json,"rc")->valueint; char *operation = cJSON_GetObjectItem(json,"operation")->valuestring; cJSON *answer = cJSON_GetObjectItem(json,"answer"); char *type =cJSON_GetObjectItem(answer,"type")->valuestring; char *text =cJSON_GetObjectItem(answer,"text")->valuestring; printf("%s\n",text);