我有两个整数并试图将它们传递给cout
。无法将操作'&'结果传递给cout
int a =1;
int b= 3;
cout<<a&b;
编译器会告诉:
Error 2 error C2676: binary '&' : 'std::basic_ostream<_Elem,_Traits>' does not define this operator or a conversion to a type acceptable to the predefined operator
但& b返回int这是可以理解的 '< <' 操作。
为什么这个错误会上升?
就是这样 –