[Error] cannot bind ‘std::ostream {aka std::basic_ostream<char>}‘ l value To'std::basic_ostream<char>&&'
时间: 2023-10-16 21:06:37 浏览: 160
This error message means that you are trying to assign a value to an output stream (std::ostream) using an lvalue (an expression that refers to an object that has a memory address) but the type of the lvalue is not compatible with the type of the output stream.
For example, if you have the following code:
```cpp
int main() {
int x = 42;
std::ostream out;
out = x;
return 0;
}
```
You will get the error message because you cannot assign an integer value to an output stream. You need to use the insertion operator (<<) to write the value to the stream:
```cpp
int main() {
int x = 42;
std::ostream out;
out << x;
return 0;
}
```
This will write the value of x to the output stream.
阅读全文