任何人,请帮助我找出函数GetList
中向量的错误。编译器给我错误C2589和C2760,但是当我单击错误时,它打开了一个名为“ vector”的选项卡:
void GetList(LISTCOMPETITOR &list)
{
COMPETITOR cm;
std::string next;
do
{
std::cin >> cm;
list.runner.push_back(cm);
do
{
next[0] = '0';
std::cout << std::endl << "Enter '1' if you want to keep adding runner or enter '0' to finish";
getline(std::cin, next);
if (next.length() > 1)
{
std::cout << std::endl << "Sorry! Please type only letter '1' or '0'.";
continue;
}
if (next[0] == '1')
{
break;
}
return;
} while (true);
} while (next[0] == '1');
}