Found a weird behaviur on my code.
Code:
char foo[] = {64, 1};
int i = 0;
char c = ((foo[i]) | (foo[(++i)]));
cout << "Text: " << c << " " << (int)c << endl;
Results:
Text: ☺ 1
I was specting "Text: A 1" instead of "Text: ☺ 1". For some reason the compiler is ignoring the "| foo[++i]" part.
Well the solution for this is quite simple, it would just take another line, but what I'm interested in is to know if this is a compiler bug or just c++ being weird.
Tested in VC10 and VC11.
edit: Added () to the code, still the same behaviou.