C Preprocessor: #define in C... advice
- by vikramtheone
Hi Guys,
I'm making a big C project and I have never come across a situation like this before so, I need your advice.
What is your opinion? Is it okay to have the constants defined within conditional preprocessors like I have done below or you advise me to do this some other way?
Any drawbacks if I do it this way?
Regards
Vikram
#define NUM_OCTAVES_4
//#define NUM_OCTAVES_5
#ifdef NUM_OCTAVES_4
#define OCTAVES 4
const unsigned char borders [4] = {11, 26, 50, 98};
#elif NUM_OCTAVES_5
#define OCTAVES 5
const unsigned char borders [5] = {11, 26, 50, 98, 194};
#endif