fgets(search_for, 80, stdin);
leaves the newline used to send the input to the programme in the input buffer, so the string passed to strstr
as second argument is in fact
"town\n"
and that is not a substring of any of the tracks
, so no match is found and nothing printed.
Remove the newline from the buffer,
size_t n = strlen(search_for);
if (n > 0 && search_for[n-1] == '\n') {
search_for[n-1] = 0;
}
to have it search for "town"
.