what is the meaning of this Logical operators combination in C
问题 i know that -> is a pointer |= is OR. what is the logical meaning of such line? TIMER0->ROUTELOC0 |= TIMER_ROUTELOC0_CC0LOC_LOC15 回答1: You're ORing in (setting) a value to a register. Your processor has a TIMER0 with a register ROUTELOC0. It likely has a bit that is "CC0LOC_LOC15" I recommend looking at the data sheet for your processor to figure out what that means specifically. 回答2: |= does not mean OR. | means OR. |= is similar to +=, that is A |= B is the equivalent of A = A | B So to