+ 3

Is there a solution in c++ if you get this error? Error: No match for operator <<

https://code.sololearn.com/cqphPCW6IqcA/?ref=app I'm learning about how to use vectors in c++, I want to print the return of the vector, but when I tried to do it with std::cout, I got this error: Error: no match for operator<< (operand types are 'std::ostream {aka std::basic_ostream}' and 'std::vector') I searched in Google about how to solve this problem, I found that I need to overloaded operator <<. But the solution is too difficult for me to understand, because I'm still learning c++. How can I solve this problem? Is there a basic solution to display the return?

14th Jan 2019, 7:35 PM
Eduardo Perez Regin
Eduardo Perez Regin - avatar
1 Antwort
0
You can write this line after all the includes: using namespace std; After that you won't have to write std:: all the time and worry where you need it.
14th Jan 2019, 8:02 PM
Mina
Mina - avatar