Sunday, September 2, 2012

ENUM vs #DEFINE

I just came across the enumerate feature in C and i was wondering the differences in using "enum" and "#define"

1) First one is essentially that "#define" is a pre-processor directive i.e. it simply does a find and replace before the compiler takes over while "enum" is a part of C.

2)we can define data types using "enum" apart from defining macros.

take a look at this article for more insight..

understanding Enums 

Enum vs #define



 

No comments:

Post a Comment