Ofxjson problems

I am currently trying to save information to a json file. I want to save x, y, xand z coordinatesinto a json file but I cannot.
Variable
//-- save variable.
ofxJSONElement *save = new ofxJSONElement();

My code (seems to work but not what I want)
for(int i = 0; i < point.size();i++)
save->append((float)(point.at(i).x));

My code (dont work)
for(int i = 0; i < point.size();i++)
save["position][i][“x”] = ((float)(point.at(i).x));

//-- save variable.
ofxJSONElement save;

for(int i = 0; i < point.size();i++)
    save["position"][i]["x"] = point.at(i).x;

Don’t use new. Just create the element and use it.

Ok thanx.