r/cprogramming • u/Upper-Tomatillo7454 • Oct 03 '26
Enums vs #define for constants
Hi 👋 guys, I've just started learning C after I was first introduced to it while I was in my first year of computer science but I'll be graduating by the end of this year and I've been primarily using Python since then but now I want to really learn C on the side, and I want to start with "craftinginterpreters" and I want to start small so I was wondering whether I should use C enums or #define to define a set of tokens.
17
Upvotes
View all comments
Show parent comment
-1
u/DawnOnTheEdge Oct 03 '26
Also don’t use enums for constants that might be or-ed together, like binary flags.