-
Notifications
You must be signed in to change notification settings - Fork 2
JSON_GET_INT_A
Jurek Muszyński edited this page Mar 31, 2022
·
6 revisions
Retrieves integer value from JSON array.
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;
for ( int i=0; i<JSON_COUNT(&json); ++i )
{
if ( !JSON_GET_INT_A(&json, i, &value) )
OUT("Couldn't get %d-th value", i);
else
OUT("<p>%d-th age: %d</p>", i, value);
}
}