Click here to Skip to main content
15,847,653 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually I want to write and read data from JSON files in a C++ program.I have worked on text files and know how to implement file I/O for the same.But JSON is what I have just heard of.This is a simple program that involves reading,writing and modifying records. The records are read from and write onto JSON files.

I searched over the internet and found I need a parser library for the same.So I downloaded JSONcpp. But there's no documentation regarding how to use it to encode and decode JSON text.Any help or helpful links are most welcomed!
Posted
Updated 13-Jun-14 23:31pm
v2
Comments
Mohibur Rashid 14-Jun-14 4:27am    
http://json.org/

1 solution

The project page includes a "how to" example.

http://jsoncpp.sourceforge.net/[^]

C++
Json::Value root;   // will contains the root value after parsing.
Json::Reader reader;
bool parsingSuccessful = reader.parse( config_doc, root );
if ( !parsingSuccessful )
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900