Why isn't this working?
fwrite( notes->notes, sizeof( NOTE ), notes->nChildren, dbFile );
notes->notes is an array of NOTE, the array size being notes->nChildren ...
Printable View
Why isn't this working?
fwrite( notes->notes, sizeof( NOTE ), notes->nChildren, dbFile );
notes->notes is an array of NOTE, the array size being notes->nChildren ...
Don't know. Things to check include return value from fwrite, whether notes->notes is pointing to what you think it should be pointing to, notes->nChildren is a valid value (and that there are that number of NOTES pointed to by notes->notes) and that dbFile is a valid *FILE. Try replacing some of the values with literals and see if that works as expected.
If you need more help you're going to have to post more code, preferrably a small example that reproduces the problem.
Why don't you check the return result from fwrite(), and also the return result from ferror() following a call to fwrite()
Alrighty, I've found my problem I think ...
nChildren = 0, but it is still written as expected...But notes isn't written because it is 0 .. :)
Should be able to fix it, thanks ...