无可用过载+=

No Viable Overloaded +=?

本文关键字:      更新时间:2023-10-16

有人能告诉我为什么我收到这个"没有可行的过载"吗?我很困惑为什么我会收到这个。。。。我是个菜鸟。

int main()
{
char ch;
    vector<int> temp;
    ifstream infile;
    infile.open("tempsF.txt");
    if (infile.fail())
    {
        cout << "Could not open file numbers." << "n";
        return 1;
    }
    int data;
    infile >> data;
    while (!infile.eof())
    {
        if(isalpha(ch) || ispunct(ch))
        {
            if(isupper(ch) && ch != 'n')
                temp += " ";<<<<<<<<<<<<<<<<<<<<<<<<< No Viable Overloaded '+='
                temp += ch;<<<<<<<<<<<<<<<<<<<<<<<<<< No Viable Overloaded '+='
        }
    }

这不是使用std::vector<int>的方式。尝试更类似的东西:

temp.push_back(42);

或者你想要std::vector<std::string>,那么你可以:

temp.push_back(" ");

但没有为CCD_ 4定义CCD_。

相关文章:
  • 没有找到相关文章