struct blabla {
int a;
char b;
}
....
struct blabla blablavar;
blablavar.a = 1;
blablavar.b = 'a';
fopen...
fwrite(fd,&blablavar,sizeof(blablavar));
........... like this?For binary data using streams similar like
https://stackoverflow.com/questions/33107332/writing-reading-binary-file-in-nim
But there is also json and
There's also NESM, which provides easy to use DSLs for serializing and deserializing objects in binary form.
thank you fort reponse
my solution simple
var personList = newSeqPerson
personList.add(Person(nom: "Koch", prenom:"karl", age: 23)) personList.add(Person(nom: "Pan", prenom:"Peter", age: 12))
echo personList[1].nom
personList.add(Person(nom: "Moranne", prenom:"Bob", age: 30))
echo personList[2]
etc... thank you