M
manochavishal
Hi,
In standard i have come across:
6.2.6 Representations of types
6.2.6.1 General
6.When a value is stored in an object of structure or union type,
including in a member
object, the bytes of the object representation that correspond to any
padding bytes take
unspecified values.42) The value of a structure or union object is
never a trap
representation, even though the value of a member of the structure or
union object may be
a trap representation.
I have not understood what padding bytes are and why they are used in
representation.
Even i have not understood the paragraph 4.
4.Values stored in non-bit-field objects of any other object type
consist of n × CHAR_BIT
bits, where n is the size of an object of that type, in bytes. The
value may be copied into
an object of type unsigned char [n] (e.g., by memcpy); the resulting
set of bytes is
called the object representation of the value. Values stored in
bit-fields consist of m bits,
where m is the size specified for the bit-field. The object
representation is the set of m
bits the bit-field comprises in the addressable storage unit holding
it. Tw o values (other
than NaNs) with the same object representation compare equal, but
values that compare
equal may have different object representations.
what is difference between a bit-field and a non-bit-field object.
*Values stored in bit-fields consist of m bits,
where m is the size specified for the bit-field.*
This i couldn't understand.
Anyone please help me in understanding this.
Thanks in advance
In standard i have come across:
6.2.6 Representations of types
6.2.6.1 General
6.When a value is stored in an object of structure or union type,
including in a member
object, the bytes of the object representation that correspond to any
padding bytes take
unspecified values.42) The value of a structure or union object is
never a trap
representation, even though the value of a member of the structure or
union object may be
a trap representation.
I have not understood what padding bytes are and why they are used in
representation.
Even i have not understood the paragraph 4.
4.Values stored in non-bit-field objects of any other object type
consist of n × CHAR_BIT
bits, where n is the size of an object of that type, in bytes. The
value may be copied into
an object of type unsigned char [n] (e.g., by memcpy); the resulting
set of bytes is
called the object representation of the value. Values stored in
bit-fields consist of m bits,
where m is the size specified for the bit-field. The object
representation is the set of m
bits the bit-field comprises in the addressable storage unit holding
it. Tw o values (other
than NaNs) with the same object representation compare equal, but
values that compare
equal may have different object representations.
what is difference between a bit-field and a non-bit-field object.
*Values stored in bit-fields consist of m bits,
where m is the size specified for the bit-field.*
This i couldn't understand.
Anyone please help me in understanding this.
Thanks in advance