Use Enum or #define ?
- by sub
I'm building a toy interpreter and I have implemented a token class which holds the token type and value.
The token type is usually an integer, but how should I abstract the int's?
What would be the better idea:
// #defines
#define T_NEWLINE 1;
#define T_STRING 2;
#define T_BLAH 3;
/**
* Or...
*/
// enum
enum TokenTypes
{
t_newline,
t_string,
t_blah
};