#include
#include
char tracks[][80] = {
\"I left my heart in Harvard Med School\",
\"Newark, Newark - a wonderful town\",
\"Dancing
The problem with the code above is that it doesn't account for the fact that fgets leaves the newline in the string. So when you type town and hit enter, you'll end up searching for "town\n".
A cheap way to solve this would be to fix the string after calling fgets
search_for[strlen(search_for) - 1] = 0;