Well , I am trying to create a bees game as part of my assignment ..
Now in this simple game I should use a text file .. and the text file is to create different game stats in different lines..
eg..
"10 (number of bees)
0 (number ofinfected bees)
1000 (money balance)
40 (amount of honey)
0 (amount of beeswax)"
I am trying to create the function that is to update the file but can't manage to complete it.
in the function should I pass all the variables ? .. and then use fprintf and recall them there ?
void updatefile( //should I pass anything there ? )
{
FILE *f;
f=fopen("gamestat.txt","w");
fprintf(f,
.....
fclose(f);
}