在使用「宏定義集1」執行以下代碼時,遇到錯誤「C2065:'C1':未聲明的標識符」。C/C++預處理歧義
在使用「宏定義設置2」,代碼運行給予的2
輸出我猜它是與預處理符號化。請解釋。
#include <iostream>
// Macro Definitions Set 1
#define A 1
#define D(n) B(n)
#define B(n) C##n
#define CA 2
// Macro Definitions Set 2
//#define A 1
//#define D(n) C##n
//#define CA 2
int main()
{
printf ("%d", D(A));
}
一個類似的問題,在這裏有相同的答案:http://stackoverflow.com/a/2751891/6210 – MSN