OiO.lk English C# dealing with macros in C
C#

dealing with macros in C


macros without parenthesis is confusing me

#include <stdio.h>
#define Inverse(A) -A

int main(void)
{
    int x = 8;
    
    int y = -Inverse(x+3);
    printf("%d", y);
}

the unary negation operator in front of Inverse() is confusing me.
I thought the result of
-Inverse(x+3)
would be
–x+3 which is 10 (7+3)



You need to sign in to view this answers

Exit mobile version