Can someone tell my why won\'t this function work? I just can\'t get it...
void writeRegister(FILE *arq, Book *L){ //writes in actual file position
char
The first parameter of fwrite expects a pointer.
Lines such as the following:
fwrite(L->PAGES, sizeof(int), 1, arq);
Should be written as follows:
fwrite(&(L->PAGES), sizeof(int), 1, arq);
Sames goes for YEAR and PRICE members of that struct
fwrite(&(L->YEAR), sizeof(int), 1, arq);
...
fwrite(&(L->PRICE), sizeof(float), 1, arq);
Note, you don't need to make the same change for TITLE, PUBLISHER, and AUTHOR because the type of those member fields are already pointers (char*).