Hi!
Here is the quotation from a book called C pitfalls:
I am new to CS and programming. Please, explain what does it mean:Suppose that the defined constant FLAG is an integer with
exactly one bit turned on in its binary representation (in other words, a power of two), and you want to test whether the integer variable flags has that bit turned on. The usual way to write this is:
if (flags & FLAG) ...
an integer with exactly one bit turned on?
What value does FLAG have in such case? I know that char is 1 bit,
but I assume the FLAG is defined in the following way:
What value might it be?Code:#define FLAG somevalue
Thanks!