このコードを実行すると、奇妙な結果になります
void MovieDatabase:: showMovie(const string mtitle){
cout << "The informations about the" << mtitle << endl;
for(Movie* cur = headMovie; cur ->next !=NULL; cur= cur->next){
if(cur -> title == mtitle){
cout <<"Movie title is "<< cur ->title << endl;
//cout < "The name of director is " << cur -> firstNameOfDirector << endl;
cout << "The last name of director is " << cur -> lastNameOfDirector <<endl;
cout << "The year that the movie is released " << cur -> year << endl;
cout << "The day that the movie is released " << cur -> day << endl;
cout << "The month that the movie is released " << cur -> month << endl;
}
}
cout << endl;
}
これが私が映画のタイトルをチェックしているコードであり、それらがリンクリストにある場合は、映画に関する詳細情報を印刷しています。ただし、出力として、次の行を出力するだけです。
cout << "The informations about the" << mtitle << endl;`
誰もが助けてくれる理由がわかりませんでしたか?