我无法理解预处理器是如何工作的以及##
在这个特定示例中代表什么
#include <stdio.h>
#define TEMP_KEY(type,Key) (TEMP_##type | Key)
enum TEMPKey_Type
{
TEMP_UNKNOWN = 0,
TEMP_SPECIAL ,
TEMP_UNICODE
};
enum Actual_Key
{
TEMP_RIGHT = TEMP_KEY(UNKNOWN,0x1),
TEMP_LEFT = TEMP_KEY(SPECIAL,0x1),
TEMP_UP = TEMP_KEY(UNICODE,0x1)
};
int main()
{
printf("\n Value of TEMP_RIGHT : %d ",TEMP_RIGHT);
printf("\n Value of TEMP_LEFT : %d ",TEMP_LEFT);
printf("\n Value of TEMP_UP : %d ",TEMP_UP);
return 0;
}
这是如何
#define TEMP_KEY(type,Key) (TEMP_##type | Key)
工作的,或者在预处理过程中如何以及究竟TEMP_##type
替换了什么?