The following macro works:
#define DEBUG(msg, ...) printf(msg, __VA_ARGS__)
But when I add my own function, it says error: '__VA_ARGS__' was not declared in this scope
.
My code:
void Debug(const char* msg, ...) {
printf(msg, __VA_ARGS__);
}
#define DEBUG(msg, ...) Debug(msg, __VA_ARGS__)
Is there any way to do so?