OK that was a bad example, but when chaining << operators on MSVC 6.0 the expression is evaluated from right to left, but is undefined and depends on the implementation (so not good practice) -
Code:
#include <iostream>
#include <iomanip> // for use of setw(x)
using std:: cout;
using std::endl;
using std::setw;
int foo(int* i,char* a)
{
cout << a;
return (*i)++;
}
int main ()
{
int count=1, num = 0;
for(count = 1; count <= 20;count++)
{
cout <<foo(&num,"first ") << "\t" <<foo(&num,"second ")<<endl;
}
cout << endl;
return 0;
}