What's the return value (not printed) of
cout << 1, 2, 3, 4, 5;
How can I debug this code?
I need explain how work ostream and cout also.
What's the return value (not printed) of
cout << 1, 2, 3, 4, 5;
How can I debug this code?
I need explain how work ostream and cout also.
The return value is an int
with the value 5
. As side effect, 1
will be printed.
#include <iostream>
using namespace std;
int main(void)
{
auto rv = (cout << 1, 2, 3, 4, 5);
std::cout << rv;
return 0;
}