Greetings everyone, I am a newbie to C and eager to learn.
Below is a snippet and reworded version of my problem, the scanf entry for my arrayone[] integer values are not being written to the text file. Everything else in the code is pretty much working except that bug. Is the snippet below sufficient for me to get some insight?
regards.
Code:
void loadgame(struct gamerecord arrayone[], int size)
{
int i;
gm = fopen("gameinformation.txt", "a");
if (gm != NULL)
{
for (i = 0; i < size; ++i)
{
printf("\nEnter game name: ");
scanf("%s", arrayone[i].title);
printf("Enter The sequence number :");
scanf("%d", arrayone[i].sequence);
printf("Enter The list number :");
scanf("%d", arrayone[i].list);
//write items of data to the file
fprintf(gm, "\n%s\t", arrayone[i].title);
fprintf(gm, "%d\t", arrayone[i].sequence);
fprintf(gm, "%d\t", arrayone[i].list);
fclose(gm);
}
}