title: C++ boost parse dynamically generated json string (not a file)
body: <p>I am trying to make a minimal example of reading a json string that is passed as a command line arg with boost.  I am very new to C++ and to boost.</p>
  
  <p>My code is:</p>
  
  <pre><code>int main (int argc, char ** argv)
  {
    boost::property_tree::ptree pt;
    boost::property_tree::read_json(argv[1], pt);
    cout &lt;&lt; pt.get&lt;std::string&gt;("foo");
  }
  </code></pre>
  
  <p>I am calling it like</p>
  
  <pre><code>./myprog "{ \"foo\" : \"bar\" }"
  </code></pre>
  
  <p>But I get a 'cannot open file error'.  How do I get boost to read a std::string or a char* rather than a file?</p>
  
  <p>Thanks</p>