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
·
6 revisions
bool JSON_GET_STR_A(JSON *json, int index, char *retval, size_t maxlen)
Description
Retrieves string value from JSON array. If element is of different type (i.e. integer) then string representation will be returned.
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
{
char value[256];
for ( int i=0; i<JSON_COUNT(&json); ++i )
{
if ( !JSON_GET_STR_A(&json, i, value, 255) )
OUT("Couldn't get %d-th value", i);
elseOUT("<p>%d-th name: %s</p>", i, value);
}
}