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 ++
This statement
cout << x.f() << xp->f() << X::f();
can be rewritten like
cout.operator <<( x.f() ).operator <<( xp->f() ).operator <<( X::f() );
The order of evaluations of expressions used as arguments in this statement is unspecified. So the compiler can evaluates them for example from left to right or from right to left. Thus using different compilers you can get different results.:)
To get a deterministic result you should rewrite statement
cout << x.f() << xp->f() << X::f();
for example like
cout << x.f();
cout << xp->f();
coit << X::f();