-
Notifications
You must be signed in to change notification settings - Fork 2
JSON_GET_INT
Jurek Muszyński edited this page Mar 31, 2022
·
5 revisions
Retrieves integer value from JSON object.
TRUE if element has been found, otherwise FALSE.
JSON json={0};
if ( !JSON_FROM_STRING(&json, some_string) )
OUT("some_string is not a JSON");
else
{
int value;
if ( !JSON_GET_INT(&json, "age", &value) )
OUT("Couldn't get age");
else
OUT("<p>Age: %d</p>", value);
}