title: How to read a json file into a C++ string
body: <p>My code like this:</p>
  
  <pre><code>std::istringstream file("res/date.json");
  std::ostringstream tmp;
  tmp&lt;&lt;file.rdbuf();
  std::string s = tmp.str();
  std::cout&lt;&lt;s&lt;&lt;std::endl;
  </code></pre>
  
  <p>The output is <code>res/date.json</code>, while what I really want is the whole content of this json file.</p>