I'm having problems inflating a struct using a JSON file, in fact I do not know how to do this, I've been searching the JsonCpp library, but I was not successful.
Here's a simple example of my code:
#include <iostream>
using namespace std;
struct Itens{
int id, tipo, valor;
};
int main() {
funcaoEncherStruct();
return 0;
}
void funcaoEncherStruct(){
//Segue função aqui
}
JSON file:
{
"Itens": {
"Produto1": {
"id": 1,
"tipo": 1,
"valor": 20,
},
"Produto2": {
"id": 2,
"tipo": 3,
"valor": 33,
},
"Produto3": {
"id": 3,
"tipo": 6,
"valor": 60,
}
}
}