How to put a struct in json format?

Asked by At

I have to put this struct :

typedef struct                  
   int codigo_pedido;
   char descricao[20];


in Json format. The Goal is, for anytime i acess it values i should do a thing like this, for Ex : Pedido.getString(codigo)(or anything like that to acess elements is JSON), to acess the value of codigo in the struct. I have been googling this but all the few solutions i saw were not very conclusive. I really appreciate some help, thank you.

0 Answers