constant vs. define

See the following codes to understand constant vs. define.

const type variable #define type variable
It has a specific data type such as int, float, char

OUTPUT

pi = 3.141600

All #define type data are auto adjusted.

OUTPUT

value of pi = 3.141600


Next Previous