[ CnUnix ] in KIDS 글 쓴 이(By): swhan (Nameless1) 날 짜 (Date): 2004년 10월 18일 월요일 오후 12시 56분 51초 제 목(Title): Re: [질문] 가변인자와 Macro에 대해. 저는 이렇게 합니다만.. #define XXXX_DEBUGOUT(MSG_LEVEL, XFMTS...) { if( (MSG_LEVEL) <= g_debugLevel ) { fprintf(debugoutfile, "%-6d:%d:%-35s(%4d):%s() ",getpid(),MSG_LEVEL,__FILE__,__LINE__,__FUNCTION__); fprintf( debugoutfile, XFMTS); fflush(debugoutfile); } } 새로 함수를 만들어서 FILE과 LINE을 출력해주느니 그냥 printf를 2번 쓰는게 낫지 싶습니다. 꼭 함수 하나로 하셔야한다면.. void Dprint( char*file, int line, char *xfmts,...) { ... va_start(ap,xfmts); ...가 되겠지요 } |