what is "cout<<cout<<"

I had an exam in C++ today
There was a question to find output.
There was a code like
cout<<cout<<X[0]*3<<endl;
When i tried it in computer, i got the memory address of X[0].
What does " cout<<cout<< " mean??
You did not get &x[0], you got &cout. (sort of)
That's because ostream has an operator void* inherited from ios_base.
1
2
3
4
operator void *() const
{	// test if any stream operation has failed
    return (fail() ? 0 : (void *)this);
}
Topic archived. No new replies allowed.