Click here to Skip to main content
14,774,693 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC: Most recently used (MRU) files Pin
Victor Nijegorodov11-Jan-21 0:09
MemberVictor Nijegorodov11-Jan-21 0:09 
QuestionReading the Whole Array of Data from JSON Pin
Litu Sahoo10-Jan-21 5:55
MemberLitu Sahoo10-Jan-21 5:55 
QuestionRe: Reading the Whole Array of Data from JSON Pin
David Crow10-Jan-21 6:32
MemberDavid Crow10-Jan-21 6:32 
AnswerRe: Reading the Whole Array of Data from JSON Pin
Litu Sahoo10-Jan-21 7:21
MemberLitu Sahoo10-Jan-21 7:21 
QuestionRe: Reading the Whole Array of Data from JSON Pin
David Crow10-Jan-21 10:05
MemberDavid Crow10-Jan-21 10:05 
GeneralRe: Reading the Whole Array of Data from JSON Pin
Victor Nijegorodov10-Jan-21 10:57
MemberVictor Nijegorodov10-Jan-21 10:57 
GeneralRe: Reading the Whole Array of Data from JSON Pin
Litu Sahoo10-Jan-21 22:28
MemberLitu Sahoo10-Jan-21 22:28 
GeneralRe: Reading the Whole Array of Data from JSON Pin
Litu Sahoo11-Jan-21 4:50
MemberLitu Sahoo11-Jan-21 4:50 
Hi
I modified the program but still not able to get the whole array of data Under Items. Below is the sample code. Please let me know where it is wrong.

namespace pt=boost::property_tree;
pt::ptree root;
pt::ptree items;
pt::ptree obsrvtns;
pt::ptree obsrvtns1;
pt::read_json(filepath,root);

obsrvtns=root.get_child("Header");
cout<<"Header size is "<<obsrvtns.size()<<"\n";
for="" (boost::property_tree::ptree::iterator="" itprop="obsrvtns.begin();" !="obsrvtns.end();" ++itprop)
="" {
="" cout<<itprop-="">first<<": "<<itprop->second.get_value<string>()<<"\n";
}

items=root.get_child("Serial");
cout<<"Series Size is "<<items.size()<<"\n";
for(boost::property_tree::ptree::iterator="" it="items.begin();it!=items.end();++it)
" {
="" cout<<"second="" size="" is="" "<<it-="">second.size()<<"\n";
for(boost::property_tree::ptree::iterator it1=it->second.begin();it1!=it->second.end();++it1)
{
cout<<it1->first<<": "<<it1->second.get_value<string>()<<"\n";
if(it1->first=="Item")
{
/*obsrvtns1=it1->second.get_child("Items");
cout<<"check \n";*/

//BOOST_FOREACH(boost::property_tree::ptree::value_type &v,root.get_child("Header.Serial.Item"))
BOOST_FOREACH(boost::property_tree::ptree::value_type &v,root.get_child("Item"))
{
cout<
QuestionHow to use C program to open a text file using Notepad? Pin
Goh Kak Ng9-Jan-21 16:23
MemberGoh Kak Ng9-Jan-21 16:23 
AnswerRe: How to use C program to open a text file using Notepad? Pin
Mircea Neacsu9-Jan-21 16:38
mvaMircea Neacsu9-Jan-21 16:38 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Goh Kak Ng9-Jan-21 18:26
MemberGoh Kak Ng9-Jan-21 18:26 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Dave Kreskowiak9-Jan-21 18:31
mveDave Kreskowiak9-Jan-21 18:31 
SuggestionRe: How to use C program to open a text file using Notepad? Pin
Richard Deeming11-Jan-21 23:29
mveRichard Deeming11-Jan-21 23:29 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Dave Kreskowiak12-Jan-21 6:54
mveDave Kreskowiak12-Jan-21 6:54 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Goh Kak Ng19-Jan-21 3:09
MemberGoh Kak Ng19-Jan-21 3:09 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Richard Deeming19-Jan-21 22:24
mveRichard Deeming19-Jan-21 22:24 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Victor Nijegorodov9-Jan-21 22:42
MemberVictor Nijegorodov9-Jan-21 22:42 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Goh Kak Ng10-Jan-21 2:44
MemberGoh Kak Ng10-Jan-21 2:44 
QuestionRe: How to use C program to open a text file using Notepad? Pin
David Crow9-Jan-21 17:49
MemberDavid Crow9-Jan-21 17:49 
AnswerRe: How to use C program to open a text file using Notepad? Pin
Mircea Neacsu9-Jan-21 18:11
mvaMircea Neacsu9-Jan-21 18:11 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Goh Kak Ng9-Jan-21 18:28
MemberGoh Kak Ng9-Jan-21 18:28 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Mircea Neacsu9-Jan-21 18:41
mvaMircea Neacsu9-Jan-21 18:41 
GeneralRe: How to use C program to open a text file using Notepad? Pin
Goh Kak Ng11-Jan-21 2:59
MemberGoh Kak Ng11-Jan-21 2:59 
QuestionOnMouseWheel and OnSetCursor interaction Pin
Member 132515887-Jan-21 17:01
MemberMember 132515887-Jan-21 17:01 
AnswerRe: OnMouseWheel and OnSetCursor interaction Pin
Richard MacCutchan7-Jan-21 22:13
mveRichard MacCutchan7-Jan-21 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.