15-11-2012, 10:49 AM
TOPICS IN C
C PRESENTATIONS.pptx (Size: 61.23 KB / Downloads: 23)
ENUM(ENUMERATION)
We are using enum as a data type.
It is a keyword which can be used to automatically assign values to names.
An enumerated variable defines a sequence set of integer constants.
If any explicit value is not assigned to the enum constants, then the default initial value is 0, the next value is previous constant value
+1 and so on.
An enum constant carries only an integer value, it doesn’t carry any float or double type values.
Enumerated constants are limited within the range of values of signed integers.
BIT FIELDS
While declaring a structure having integer type structure elements the bit field size can be given when the range of the values to be stored.
Use of this bit field will lead to sufficient use of the memory.
The size of a structure where bits size is mentioned for the elements can be calculated as follow: