Quantcast
Viewing latest article 4
Browse Latest Browse All 4

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

#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 latest article 4
Browse Latest Browse All 4

Trending Articles