Original Post
I have a class declaration:
class Item
{ public:
int id;
Item(int n){id=n};
};
I use the fwrite() to write e.g 3 instances of this class in a file.If I want to add another one instance , what to I do?I try to go to end of file with
fseek(fp,0,SEEK_END)
and then to add the instance with fwrite() but something goes wrong.Can anyone help me or propose another way to do it?
Thanks in advance.