Hi,
Govtcheez told you why it won't work, CHAR CH needs to be initialized before the first loop....To tidy up you could use library file #include <conio.h> and use getch(); instead of scanf for character input and #include <ctype.h> for to lower function.
Also you cannot use assignment op = in if comparison, use is equal to (==), you are using not equal to y, there for when y was selected the loop ended next comparison test. There is now no need for the declaration of char ch; get rid.
In the changed code below I have implemented the above, and it compiles ok.
Code:
printf("\nWelcome to Wimamp+");
printf("\nWould you like to add a song to your playlist ('y' or 'n')?");
while (tolower(getch())== 'y'){
printf("\nEnter the song # you would like to add:");
scanf("%d",&son);
printf("\nHow many minutes long is song %d?",son);
scanf("%d",&min);
printf("\nHow many seconds long is song %d?",son);
scanf("%d",&sec);
total_left = (total_left - (min*60) - sec);
tt = (tt + (min*60) + sec);
if (total_left >= 0){
printf("Song #%d will fit on the cd you may include it.\n",son);
mysonlist[son] = son;
myminlist[son] = min;
myseclist[son] = sec;
}
if (total_left <= 0){
printf("Song #%d will not fit onto the cd you can't include it.\n",son);
}
/*prompt user for next entry*/
printf("\nWould you like to add a song to your playlist ('y' or 'n')?");
} // end while