/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>

#include "cJSON.h"

int main()
{
    char *json = "{ \"v\": 100000000000000001 }";
    printf("%s\n", json);
    cJSON *o = cJSON_Parse(json);
    int v1 = cJSON_GetObjectItem(o, "v")->valueint;
    printf("int: %d\n", v1);
    double v2 = cJSON_GetObjectItem(o, "v")->valuedouble;
    printf("double: %f\n", v2);
    char *v3 = cJSON_GetObjectItem(o, "v")->valuestring;
    printf("string: %s\n", v3);
    return 0;
}
