-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
取某一个value 怎么用呢? #2
Comments
我在这个issue里有介绍接口的用法: |
{ 用哪个方法get("userName") 的值。 |
{
const char *doc = " { ... } ";
json_value_t *val = json_value_parse(doc);
if (val)
{
const json_object_t *obj = json_value_object(val);
if (obj)
{
const json_value_t *v = json_object_find("userName", obj);
if (v)
{
const char *str = json_value_string(v); // "111111"
...
}
...
}
json_value_destroy(val);
}
} |
谢谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
json_value_t *json_value_parse(const char *doc);
这里的返回 json_value_t 不是整个json吗?
const char *json_value_string(const json_value_t *val);
再把整个json_value_t 作为参数 去取value 吗?
The text was updated successfully, but these errors were encountered: