I'm a C++ beginner, currently studying stacks, with a basic knowledge of both C and C++. I am using Code::Blocks as my IDE with the MingW compiler that comes along. I have a question regarding the operators >> and <<.
What would happen if both the operands are streams?
say something like:
2 using namespace std;
4 int main()
6 cout << cin;
7 cin >> cout;
8 return 0;
The code of line 4 compiles fine, and executes too, giving me the answer:
Whereas line 5 gives me an error stating ambigous overload for operator>>.
Further, I tried a simple variation: I changed 'cin' in line 4 to '&cin'. The resulting execution gave me a slightly different answer: 0x445460
Could anyone explain to me:
a) the significance of 0x445468?
b) why line 4 doesn't generate an error?
c) why line 5 does?
d) why changing cin to &cin decreased the output by 8?