안녕하세요. 다음의 코드 좀 봐주시기 바랍니다..
//test.h
#define _DEBUG(s,...) \
Dprintf(__FILE__, __LINE__, s, __VA_ARGS__)
//test.c
void Dprintf(const char* file, int line, const char* fmt, ...)
{
......
}
//main.c
_DEBUG(" This is test? %d", (int) variables); <== 잘 됨.
_DEBUG(" This is test"); <== Error남..
위에서 두번째의 경우, 가변인자로 넘겨주는 곳이 없을때 왜 에러가 나고,
두번째 처럼 쓰고 싶을때는 어떻게 해야 하는지 알려주세요..