ERROR: no match for 'operator<<" in 'std::cout

前端 未结 5 1257
孤城傲影
孤城傲影 2021-01-22 13:32

I realize this error is usually due to some syntax or type issues but I am not sure how to solve this problem. I think it may do with the type of findRt.

vector&         


        
5条回答
  •  旧时难觅i
    2021-01-22 14:02

    Use an iterator http://www.cplusplus.com/reference/std/iterator/.

    Example would be

    vector::iterator it;
    
    cout << "myvector contains:";
    for ( it=myvector.begin() ; it < myvector.end(); it++ )
        cout << " " << *it;
    
    cout << endl;
    
    return 0;
    

    This assumes you have an operator<< for the triangle type.

提交回复
热议问题