1
I have a file JSON
with employee data and wish to read this file in C++
to pass para
a flash drive and export this file, how to proceed?
Follows file JSON:
":"Alexandre N. da C.Neves","ID":"213","PIS":"00000000","Time":1456229448}...
and the program in C++ more or less like this:
typedef struct funcionario // struct com 100 elementos
{
char CodBarras[11];
char BioDados[512];
char Passwd[11];
char MiFareDado[21];
char Nome[53];
char ID[11];
char PIS[13];
char Aux[5];
long int Tempo;
}functionaries[100]; // array para rodar essa struct 100x
the program has to load the JSON file and load into Struct.
thanks in advance
Are you sure that’s not C?
– Pablo Almeida
this is C but I need to take the JSON file, and load this Struct in C. ie read the JSON file.
– Lucas
Is that you wrote in the title, in the tags and in the description "C++" and not "C".
– Pablo Almeida
https://github.com/open-source-parsers/jsoncpp
– Luiz Vieira
Can you use/compile a little C++, or are you required to have the code entirely in C? If it is 100% in C it will take a lot more work; using C++, you can use JSONCPP as @Luizvieira mentioned, to decode into a Json object::Value, and then popular your struct from it.
– Fabio Ceconello
Solved your doubt?
– durtto