I\'ll skip the headers
class X {
int i;
static int j;
public:
X(int ii = 1) : i(ii) {
j = i;
}
static int incr() {
return ++
The stream operator is simply an operator. C++ allows operators to be defined a multitude of ways. What you're seeing is the << operator for strings. What you're doing is the same thing as:
cout << "word1" << "word2" << "word3";
The expect output for that is:
"word1word2word3"
However, the evaluation order is determined by the implementation of the << operator. Usually the above is equivalent to:
(((cout << "word1") << "word2") << "word3");
Replace the strings with functions instead and you see the first one evaluated is actually "word3". This is not strictly the case, just what you'll usually see.
(((cout << func1()) << func2()) << func3());
Evaluation order would be func3, func2, func1, with print order the return of func1, func2, func3.