No, I'm good now.
This is what i did to fix that (I believe). I added "gar" as an int variable, just to be sure nothing else was disturbed.
Code:
int main(void)
{
int i, rating_filter, songCount, gar;
char oper;
// song oneSong[99];
int j = 0;
printf("How many songs will be entered?");
scanf("%d", &songCount);
gar = getchar();
for(i = 0; i <= songCount - 1; i++)
{
printf("Enter the information below for songs:\n");
printf("Artist: ");
fgets(oneSong[i].artist, 40, stdin);
printf("Title: ");
fgets(oneSong[i].title, 60, stdin);
printf("Rating(0-5): ");
scanf("%d", &oneSong[i].rating);
gar = getchar();
}
while(13 == 13)
{
printf("Select the operation to perform --(t)itle,(a)rtist,(r)ating,(f)ilter,(q)uit");
scanf("%c", &oper);
if(oper == 't')
{
printf("Songs by title:\n");
//song_by_title(oneSong, songCount);
for(j = 0; j <= songCount; j++)
{
printf("<%s--%s--%d>\n",oneSong[j].title, oneSong[j].artist, oneSong[j].rating);
}
}
else if(oper == 'a')
{
printf("Song by artists:\n");
//song_by_artist(oneSong, songCount);
for(j = 0; j <= songCount; j++)
{
printf("<%s--%s--%d>\n",oneSong[j].title,oneSong[j].artist,oneSong[j].rating);
}
}
else if(oper == 'r')
{
printf("Songs by ratings:\n");
//song_by_artist(oneSong, songCount);
for(j = 0; j <= songCount; j++)
{
printf("<%s--%s--%d>\n",oneSong[i].title, oneSong[i].artist,oneSong[i].rating);
}
}
else if(oper == 'f')
{
printf("Enter the rating to show:\n");
scanf("%d", &rating_filter);
//song_by_title(oneSong, songCount);
for(j = 0; j <= songCount; j++)
{
printf("<%s--%s--%d>\n",oneSong[i].title, oneSong[i].artist,oneSong[i].rating);
}
}
else if(oper == 'q')
{
printf("Thank you for using!\n");
break;
}
j = 0;
}
return 0;
}
I made song array global, which is not what it should be, but you have that part working so this was a work around.