What do 0x0040 and pipe sign denote here?
问题 Here SIMPLE_EX2 is being ORed with 0x0040 and the whole this providing as an address to SIMPLE_EX1. Is my understanding correct? #define SIMPLE_EX1 (0x0040 | SIMPLE_EX2) 回答1: | is not a pipe sign in C. It's a bit-wise or. So this expression: 0x0040 | SIMPLE_EX2 Simply gets the value of SIMPLE_EX2 and sets it's 7 th bit (from right) to 1. Unlikely, but note that if SIMPLE_EX2 itself is an expression with an operator that has lower precedence than | , the overall expression may be interpreted