I need to check if my ipaddr is equal to 0.0.0.0 using a macro. I wrote the code as below, but keeps on getting an error. 

```
#define IPV4_ZEROVAL_CHECK(ip) {int d1,d2,d3,d4; return (4 == sscanf(ip, "%d.%d.%d.%d", &d1, &d2, &d3, &d4)) ? ((d1 == 0 && d2 == 0 && d3 == 0 && d4 ==0) ? 0 : 1) : 0;};

int main()
{
    char ip[16] = "0.0.1.0";
    int x = 99;
    x=  IPV4_ZEROVAL_CHECK (ipaddr);
    printf("Value of x=%d \n",x);
    return 0;
}

```

while compiling I am getting error as follows

```
ipbox [root] # gcc test.cpp -lstdc++ -o test.o
test.cpp: In function 'int main()':
test.cpp:9: error: expected primary-expression before '{' token
test.cpp:9: error: expected `;' before '{' token

```

I am missing something but just cant het my head around it. If i write is as function, it works well. I am curious why it doesn't work as a MACRO