D
dspfun
C doesn't specify the bit-layout in memory of the different types, so
how are the operations ( & | ~ ^ << >>) defined to modify the objects
(which does not have its bit-layout defined) ?
6.2.6.1p2:
Except for bit-fields, objects are composed of contiguous sequences of
one or more bytes,
the number, order, and encoding of which are either explicitly
specified or
implementation-defined.
Lets say for example:
unsigned int a = 6;
a = a & 3;
Do we know anything about the bit-layout of a?
Or do we simply know that the value of a is 2 after the last
statement, and we know nothing about the bit-layout? But why the name
bitwise operators if we don't know which bit the operator and operand
modifies?
What is the benefit of using the bit-operators if we do not know the
bit-layout of objects?
how are the operations ( & | ~ ^ << >>) defined to modify the objects
(which does not have its bit-layout defined) ?
6.2.6.1p2:
Except for bit-fields, objects are composed of contiguous sequences of
one or more bytes,
the number, order, and encoding of which are either explicitly
specified or
implementation-defined.
Lets say for example:
unsigned int a = 6;
a = a & 3;
Do we know anything about the bit-layout of a?
Or do we simply know that the value of a is 2 after the last
statement, and we know nothing about the bit-layout? But why the name
bitwise operators if we don't know which bit the operator and operand
modifies?
What is the benefit of using the bit-operators if we do not know the
bit-layout of objects?