title: Read & Parse a JSON file c++ BOOST
body: <p>As there is a lot of questions already on this, I am kind of apprehensive about asking... but</p>
  
  <p>I've looked at many different Questions and nothing from any of them is working for me. I have this code as my attempt but it doesn't work:</p>
  
  <pre><code>#include "boost/property_tree/ptree.hpp"
  #include "boost/property_tree/json_parser.hpp"
  using namespace boost::property_tree;
  ...
  std::ifstream jsonFile("test_file.json");
  if (!jsonFile){
      std::cerr &lt;&lt; "Error opening file\n";
      return -1;
  }
  ptree pt;
  json_parser::read_json(jsonFile, pt);
  for (auto&amp; array_element : pt) {
      for (auto&amp; property : array_element.second) {
          std::cout &lt;&lt; property.first &lt;&lt; " = " &lt;&lt; property.second.get_value&lt;std::string&gt;() &lt;&lt; "\n";
      }
  }
  </code></pre>
  
  <p>Its contents are in the following format:</p>
  
  <pre><code>[{"number": 1234,"string": "hello world"}, {"number": 5678,"string": "foo bar"}, ... etc }]
  </code></pre>
  
  <p>I can't get it to read out the <code>1234</code> and then the <code>hello world</code>. Infact, it just does nothing. How can I read out from my <code>.JSON</code> file?</p>