Help with creation json file

Janry
2012-04-24
2013-04-22
  • Janry
    Janry
    2012-04-24

    Hello all!
    I have problem with creation json file.

    My main.cpp

        Json::Value event;
        
        event["competitors"]["home"]["code"] = 23572;
        event["competitors"]["home"]["name"] = "Liverpool";
        event["competitors"]["away"]["code"] = 89223;
        event["competitors"]["away"]["name"] = "Aston Villa";
        
        std::cout << event << std::endl;
    

    when i run this my output like this:

    {
      " competitors" :
      {
        "  a way" :
        {
          "   c o de" : 89223,
          "   n a me" : "Aston Villa "
        }  ,
        "  h ome" :
        {
          "   c o de" : 23572,
          "   n a me" : "Liverpool"
        }
      }
    }

    what's wrong?