For your code I get problems with the <
instead of <<
and what I assume the main problem:
error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘std::vector<int>’)
cout << hello << "
";
It is telling you that there is no known way to output a whole vector to cout
.
The simple way to fix that is
cout << hello[0] << " " << hello[1] << "
";
This gets you an output of
3 2
The more complex way, with more convenient result, is to do the overloading yourself accordingly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…