Quantcast
Channel: C Pre-Processor Macro code with () and {} - Stack Overflow
Viewing all articles
Browse latest Browse all 4

C Pre-Processor Macro code with () and {}

$
0
0
#include <stdio.h>#define a (1,2,3)#define b {1,2,3}int main(){    unsigned int c = a;    unsigned int d = b;    printf("%d\n",c);    printf("%d\n",d);    return 0;}

Above C code will print output as 3 and 1.

But how are #define a (1,2,3) and #define b {1,2,3} taking a=3 and b=1 without build warning, and also how () and {} are giving different values?


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images