0
I have a little doubt about a json module in c++, I wanted to know if there is any way to take a json that already exists and increment more fields using c++,
json data = json::parse(getData());
FILE * pFile;
pFile = fopen("data.json", "a");
fputs("", pFile);
fclose(pFile);
{
"0": {
"area": "SI",
"codigo_curso": "01",
"cpf": "000.000.000-00",
"data_nascimento": "00/00/0000",
"descricao": "Breve",
"endereco": "00000-000",
"nome": "Daniel Yohan"
}
}
wanted to add more of these here with changed values:
"0": {
"area": "SI",
"codigo_curso": "01",
"cpf": "000.000.000-00",
"data_nascimento": "00/00/0000",
"descricao": "Breve",
"endereco": "00000-000",
"nome": "Daniel Yohan"
}
I’m using the lib https://github.com/nlohmann/json
Would anyone know how to get me to upload my current json then add and save again? I’ll be grateful, this is for a college job. Thank you
And that lib is the one that is using of json?
– Guilherme Nascimento
like I said, I’m using the https://github.com/nlohmann/json library, there’s the json lib
– Daniel Yohan
Sorry when you said "I’m using json’s" I understood that it was a json file, now it’s clearer, see if the answer works please.
– Guilherme Nascimento