error using json array

Nov 3, 2015 at 5:23 AM
i have this code below, and it showed error on the line
keyPointArray[i]["X-Coord"] = json::value::number(keyPoints2.at(i).pt.x);
it said that
error:function "web::json::value::operator[](const std:;string &key)" (declared at line ... ... ...) is inaccessible.
is something wrong with my code below?
void uploadKeypoints(){
    json::value keyPointArray = json::value::array();
    for (int i = 0; i < keyPoints2.size(); i++) {
        keyPointArray[i]["X-Coord"] = json::value::number(keyPoints2.at(i).pt.x);
    }
}
Coordinator
Nov 3, 2015 at 8:57 PM
On windows, the library uses wide strings. Could you try U("X-Coord") instead:
        keyPointArray[i][U("X-Coord")] = json::value::number(i);
Kavya.
Marked as answer by dredous on 11/4/2015 at 9:22 PM
Nov 5, 2015 at 5:10 AM
kavyako wrote:
On windows, the library uses wide strings. Could you try U("X-Coord") instead:
        keyPointArray[i][U("X-Coord")] = json::value::number(i);
Kavya.
Thank you so much Kavya.