You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jurek Muszyński edited this page Mar 31, 2022
·
5 revisions
bool JSON_GET_INT(JSON *json, const char *name, int *retval)
Description
Retrieves integer value from JSON object.
Returns
TRUE if element has been found, otherwise FALSE.
Example
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");
elseOUT("<p>Age: %d</p>", value);
}