#include<stdio.h>
int main()
{
int const SIZE=5;
int expr;
double value[SIZE]={2.0,4.0,6.0,8.0,10.0};
expr=1|2|3|4;
printf("%f",value[expr]);
return 0;
}
How is the above code evaluated? Especially the statement:
expr=1|2|3|4;
It's a bitwise OR.
This line:
is like:
So: