Posts

Showing posts from March, 2010

Difference Between #define and const?

Although they can be used for same purpose,constants are a useful feature that can prevent program bugs and logic errors. Unintended modifications are prevented from occurring. The compiler will catch attempts to reassign new values to constants. There are three main difference between them 1) Constant has type defined so it can be type checked by compilers. 2) These constants are variables with a definite scope. Enumerations are set of constant integer variables in C.