0 votes 0 votes how enum has differed from marco??? what is advantage/disadvantage of both??? Programming in C programming-in-c + – Hira Thakur asked Aug 18, 2017 Hira Thakur 1.7k views answer comment Share Follow See 1 comment See all 1 1 comment reply rahul sharma 5 commented Aug 18, 2017 reply Follow Share https://stackoverflow.com/questions/17125505/what-makes-a-better-constant-in-c-a-macro-or-an-enum 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes As a practical matter, there is little difference. They are equally usable as constants in your programs. Some may prefer one or the other for stylistic reasons, but I can't think of any technical reason to prefer one over the other. One difference is that macros allow you to control the integral type of related constants. But an enum will use an int. #define X 100L enum { Y = 100L }; printf("%ld\n", X); printf("%d\n", Y); /* Y has int type */ Akash Verma 1 answered Aug 18, 2017 Akash Verma 1 comment Share Follow See all 0 reply Please log in or register to add a comment.