2
이러한 매크로 '이 t은 SKIP_TEXT
또는 JOIN_TEXT
처리기 교체
#include <stdio.h>
#define SKIP_TEXT(text)
#define JOIN_TEXT(text) text
#define S(s) S_EXEC(s)
#define S_EXEC_SKIP(s) s /* Here I want to skip text */
#define S_EXEC_JOIN(s) s /* Here I want to join text */
#define S_EXEC(s) S_EXEC_##s
int main(void)
{
printf("%s\n", S(SKIP("a" TEXT("b") "c" TEXT("d")));
printf("%s\n", S(JOIN("a" TEXT("b") "c" TEXT("d")));
return 0;
}
로
TEXT
을 교체하는 방법을 알고
S()
에서 인수를 평가할 수있는 방법이 있습니까?
아니요, 전 처리기 매크로는 인수를 분리 할 수 없습니다. –