Hi,
How do i make an if/then/else macro act as a function
so that the whole thing looks like the return value?
I tried this lame attempt for starters:
#define A_FROM_B(b) \
( \
if(b < 10) { \
a = b; \
} \
else { \
a = 2*b; \
}, \
a; \
)
How do i make an if/then/else macro act as a function
so that the whole thing looks like the return value?
I tried this lame attempt for starters:
#define A_FROM_B(b) \
( \
if(b < 10) { \
a = b; \
} \
else { \
a = 2*b; \
}, \
a; \
)
Comment