title: Feed strings into RapidJson to output JSON
body: <p>I'm looking at using RapidJSON to convert some data strings to json format. This is what I have as my starting point.</p>
  
  <pre><code>#include "rapidjson/writer.h"
  #include "rapidjson/stringbuffer.h"
  #include &lt;iostream&gt;
  
  using namespace rapidjson;
  using namespace std;
  
  std::string item_name
  std::string item_address
  
  itemname = "John";
  item_address = "New York";
  
  int main() {
   StringBuffer s;
   writer&lt;StringBuffer&gt; writer(s);
  
   writer.StartObject();
   writer.String("hello");
   writer.EndObject();
  
   std:cout &lt;&lt; s.GetString() &lt;&lt;endl;
   return 0;
   }
  </code></pre>
  
  <p>The output format would be something like this:</p>
  
  <pre><code>{"item": {"name": "John", "address": "New York"}}
  </code></pre>
  
  <p>I'm confused about how I am meant to put my string contents into the json, as well as define that it should be a child of "item". </p>