The compiler may just look at the expression and then use a machine code "set bit" instruction, so, no shift will actually take place. Look at the assembly language listing the compiler creates to confirm how it is actually executing the expression. This may vary from compiler to compiler, and of course depend on the assembly language instruction set of the CPU.
Review C language fundamentals and search for "operator precedence chart" and you will realize that shift operations have precedence over logical operations; to avoid misinterpretation, whenever possible enclose with "(...)" expressions that need to be evaluated first.
There are a few points that are marked as implementation dependent in C language reference, but not this basic operator precedence thing. If the compiler does not follow the mandatory behavior, you should return it and call in your money.
Review C language fundamentals and search for "operator precedence chart" and you will realize that shift operations have precedence over logical operations; to avoid misinterpretation, whenever possible enclose with "(...)" expressions that need to be evaluated first.
Confusing question, review post #5 anyway, there you can find both opperators together (in a single expression, if you meant that); anyway here it is as perhaps you want in C-format :
Confusing question, review post #5 anyway, there you can find both opperators together (in a single expression, if you meant that); anyway here it is as perhaps you want in C-format :
In a byte there are 8 bits.
Usually they are called bit 0 up to bit 7 in descending order (7654 3210)
If you use this nomenclature (bit0 ... bit7) then
* if you want to set bit 5 you have to use "5" as shift operator. 1 << 5
To avoid confusion we prefer this nomenclature.
***********
In your example
You use "5th" bit as an equivalent to "bit5". But then you need to call the most right bit "0th bit". This is quite unusual to have a "0th something".
No one would say "I am the 0th son of my parents".