Searching through an array of structs.

The basic function of my program is that it should get the user's input for the name of a movie, the director, release year, and run time. It then stores this information in an array of structs and will do this for 5 different movies.
It should then display all the user's input and then search through and display any movie's information the user requests.
That's where my problem begins, I've tried but I'm not exactly sure how the find() function works and I don't think strcmp would help either. This is the struct I'm using and the code for the function I'm trying to make:

struct movie
{
string title;
string director;
int year;
int runtime;
};

void searchMovie(movie entries[SIZE])
{
string find;
cout << "For which movie would you like information? ";
getline(cin, find);

for (int i = 0; i < SIZE; i++)
{
if (strcmp(entries[i].title, find) == 0)
{
cout << "\tName: " << setw(25) << left << entries[i].title
<< setw(10) << "Director: " << entries[i].director << endl;
cout << "\tRelease Year: " << setw(17) << entries[i].year
<< setw(10) << "Run Time: " << entries[i].runtime <<endl;
break;
}
}
}


Any help would be much appreciated!
Topic archived. No new replies allowed.