B
BQ
Hello
Is there a way to declare 'FUNCT' via a define so that if its parameter x, a constant, is
greater than 35, it returns 56, if not, 20.
I would like that at compile time, not at run time.
So:
#define FUNCT(x) x>35?56:20
is not the answer to my question.
Could be something like
#define FUNCT(x) #if (x>35) 56 #else 20 #endif
Since the 'x' is a constant, this can be done by the preprocessor, so I suppose there's a
way to do it.
Maybe it's a stupid question but is there a solution to this issue?
Thank you in advance,
Marco Lazzaroni
Is there a way to declare 'FUNCT' via a define so that if its parameter x, a constant, is
greater than 35, it returns 56, if not, 20.
I would like that at compile time, not at run time.
So:
#define FUNCT(x) x>35?56:20
is not the answer to my question.
Could be something like
#define FUNCT(x) #if (x>35) 56 #else 20 #endif
Since the 'x' is a constant, this can be done by the preprocessor, so I suppose there's a
way to do it.
Maybe it's a stupid question but is there a solution to this issue?
Thank you in advance,
Marco Lazzaroni