How does one code a macro to return a value?
I need to create two macros max1(x,y) max2(x,y,z)
Need to find the max value of given arguments.
So I was going to use the conditional operator. I put () around everything since I want the macro to return a value.
Any help would be appreciated.Code:#ifndef _max_
#define int MAX2 = ((x > y) ? (x) : (y));
#define int MAX3 = (((MAX2) > (z)) ? (MAX2) : (z));
#endif
Thanks
SJ