mahesh kumar
Answered On : Sep 7th, 2006
Hi,
Enumeration can be done at the place where we need to assaign integer values for words,
Pre-processor dir can be used at the places where we want to give any other names to represent the original word or statement.
Login to rate this answer.
Enumeration provide convenient way to associate constant values with names , an alternative to #define with advantage that the values can be generated for you. Although variables of enum types may be declared , compilers need not check that what you store in such variable is a calid value for enum. Neverthless enum variables offer a chance of checking and so are often better that #defines. In addition debugger may be able to print values of enum variables in their symbolic forms.
Login to rate this answer.