[Solved] Error When using a Macro in C++ to validate an IP
If you really want to implement this as a macro then you need to remove the return from inside the macro. You can’t assign the “result” of your macro to a variable as it is not a single statement. #include <cstdio> #define IPV4_ZEROVAL_CHECK(ip, result) {int d1,d2,d3,d4; result = (4 == sscanf(ip, “%d.%d.%d.%d”, &d1, &d2, &d3, … Read more