Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Stupid problem with booleans

superfisi
2012-02-17
2013-05-23
  • superfisi
    superfisi
    2012-02-17

    Hi there,

    it may sound stupid to you but I can't get boolan-inputs to work with cJSON, e.g. input like this…

    {"someInput":true}
    

    … at first I thought that cJSON treats booleans like integers, but the result is always "0".

    Can someone give me a hint?

    Thanks in advance!

     
  • Dave Gamble
    Dave Gamble
    2012-05-01

    For booleans, check the type. cJSON_False / cJSON_True. :)

    Dave.