- 5
Fill in the blanks to define the macro SQR if the TRIPLE macro is defined, otherwise define TRIPLE.
#______TRIPLE #define SQR(x) (x) * (x) #______ #define TRIPLE(x) (x) * 3 #________
3 Respostas
+ 5
Why don't you try to solve it yourself?
+ 1
#ifdef TRIPLE
#define SQR(x) (x) * (x)
#else
#define TRIPLE(x) (x) * 3
#endif
0
Have a look at preprocessor directives: between them ifdef, else, endif