I\'m using a struct and array of functions, but the main thing is I don\'t know
ID: 3657910 • Letter: I
Question
I'm using a struct and array of functions, but the main thing is I don't know how to write the information to an output.txt file. I use this and there's jumbled up stuff in the file and not the actual words of what is in my program.
void SaveInvent(bball br[], int *size)
FILE *infile;
if((infile = fopen("output.txt","w"))==0)
{
printf(" CANNOT OPEN FILE ");
return;
}
//connect to the file
infile= fopen("output.txt","w");
fprintf(infile,"%d", *size);
fwrite(br, sizeof(books),*size,infile);
//close file pointer
fclose(infile);
}
Program says that's wrong