title: Parsing JSON string with jsoncpp
body: <p>I'm trying to parse a JSON string encoded with PHP and sent over TCP to a C++ client.</p>
  
  <p>My JSON strings are like this:</p>
  
  <pre><code>{"1":{"name":"MIKE","surname":"TAYLOR"},"2":{"name":"TOM","surname":"JERRY"}}
  </code></pre>
  
  <p>On the C++ client I'm using the jsoncpp libraries:</p>
  
  <pre><code>void decode()
  {
      string text =     {"1":{"name":"MIKE","surname":"TAYLOR"},"2":{"name":"TOM","surname":"JERRY"}};
      Json::Value root;
      Json::Reader reader;
      bool parsingSuccessful = reader.parse( text, root );
      if ( !parsingSuccessful )
      {
          cout &lt;&lt; "Error parsing the string" &lt;&lt; endl;
      }
      const Json::Value mynames = root["name"];
      for ( int index = 0; index &lt; mynames.size(); ++index )  
      {
          cout &lt;&lt; mynames[index] &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>The problem is that I'm not getting anything as output, not even the error about the parsing(if any).
  Could you possibly help me to understand what I'm doing wrong ?</p>