[highlight]i can't run my program because o a supposed parse error... please do help me
int UpdateSong(SongInf *list, int *get, int count, int countGet)
{
int n;
SongInf temp;
char rating[10];
char answer;
FILE *input;
while(1)
{
printf("\n\nWhich entry do you want to edit?"
"\nEnter number 0 to go back to main menu");
scanf("%d",&n);
getchar();
if(n == 0)
{
return 0;
}
else if(n <= countGet)
{
printf("\nSONG INFO");
printf("\nTitle: " ,list[get[n-1]].Title);
printf("\nArtist: " ,list[get[n-1]].Artist);
printf("\nGenre: " ,list[get[n-1]].Genre);
printf("\nAlbum: " ,list[get[n-1]].Album);
printf("\nRating: " ,list[get[n-1]].Rating);
printf("\nRemarks: " ,list[get[n-1]].Remarks);
}
else
{
printf("Invalid input. Enter answer again \n");
}
}
do
{
printf("\n\nEDIT"
"\nEnter to skip field"
"\nType exit to go back to main menu"
"\nTitle: ");
if(strcmp(gets(temp.Title),"exit")==0)
{
free(get);
free(list);
return 0;
}
printf("\nArtist: ");
if(strcmp(gets(temp.Artist),"exit")==0)
{
free(get);
free(list);
return 0;
}
printf("\nGenre: ");
if(strcmp(gets(temp.Genre),"exit")==0)
{
free(get);
free(list);
return 0;
}
printf("\nAlbum: ");
if(strcmp(gets(temp.Album),"exit")==0)
{
free(get);
free(list);
return 0;
}
printf("\nRating: ");
if(strcmp(gets(rating),"exit")==0)
{
free(get);
free(list);
return 0;
}
printf("\nRemarks: ");
if(strcmp(gets(temp.Remarks),"exit")==0)
{
free(get);
free(list);
return 0;
}
if(*temp.Title != '\0')
{
strcpy(list[get[n-1]].Title,temp.Title);
}
if(*temp.Artist != '\0')
{
strcpy(list[get[n-1]].Artist,temp.Artist);
}
if(*temp.Genre != '\0')
{
strcpy(list[get[n-1]].Genre,temp.Genre);
}
if(*temp.Album != '\0')
{
strcpy(list[get[n-1]].Album,temp.Album);
}
if(*rating != '\0')
{
temp.Rating = atoi(rating);
list[get[n-1]].Rating = temp.Rating;
}
if(*temp.Remarks!= '\0')
{
strcpy(list[get[n-1]].Remarks,temp.Remarks);
}
printf("\nNEW SONG INFO");
printf("\nTitle: %s ",list[get[n-1]].Title);
printf("\nArtist: %s",list[get[n-1]].Artist);
printf("\nGenre: %s",list[get[n-1]].Genre);
printf("\nAlbum: %s",list[get[n-1]].Album);
printf("\nRating: %d",list[get[n-1]].Rating);
printf("\nRemarks: %s",list[get[n-1]].Remarks);
while(1)
{
printf("\nDo you want to save these changes? (Y)es or (N)o? ");
scanf("%c",&answer);
getchar();
if(answer == 'Y')
{
input = fopen("MProb.txt","wb");
if(fwrite(list,sizeof(SongInf),count,input) != (unsigned)count)
{
printf("\nError in updating song"
"\nPress any key to go back to main menu");
getchar();
fclose(input);
break;
}
printf("\nUpdating complete!"
"\nPress any key to go back to main menu");
getchar();
fclose(input);
break;
}
if(answer == 'N')
{
break;
}
else
{
printf("\nInvalid input. Input again!\n");
}
free(get);
free(list);
return 0;
}
}
}