当我选择演员或电影标题时,我正在尝试编写一个存在 while 循环的 while 循环。但由于某种原因,它无法正常工作,它告诉我该行有错误while (selecton)
。有人有想法吗?
string selection;
while ( selection )
{
cin >> selection;
if ( selection == "actress" )
{
cout << "hey" << endl;
break;
}
else if ( selection == "movie title" )
{
cout << "bye";
break;
}
else
{
cout << "Please choose a selection";
}
}