I have a question about using macros in C.
First, I am trying to divide and return both the answer and the remainder from a macro. Right now I have:
which I know is not correct. Any suggestions on how I could do this?Code:#define DIVMOD(x,y,d,r) ((y)==0 ? d=0; r=0 : (d = (x)/(y); r = (x) % (y))