I am using JSONcpp library and facing problem to create json which contains / operator (like date : 02/12/2015). Below is my code:
JSONNODE *n = json_new(JSON_NODE);
json_push_back(n, json_new_a("String Node", "02/05/2015"));
json_char *jc = json_write_formatted(n);
printf("%s\n", jc);
json_free(jc);
json_delete(n);
Output :
{
"String Node":"02\/05\/2015"
}
Check here "\/
" in date, we want only "/
" in date, so my expected output should look like this:
Expected output:
{
"String Node":"02/05/2015"
}
How to get rid of it? We are using inbuilt library function and we can not modify library.