{ ret = -1; } //返回指定字符串对象的json对象 //用户 cJSON * child1 = cJSON_GetObjectItem(root, "userName"); if (NULL == child1){ ret = -1; } strcpy(user, child1->valuestring); //拷贝内容 cJSON * child2 = cJSON_GetObjectItem(root, "nickName"); if (NULL == child2) ...