c++ # x 表示 將 x 變量 變成 字符串
c++ a##1 表示 連接的意思,
下面 上代碼:
// testjin.cpp : 定義控制台應用程序的入口點。
//
#include stdafx.h
#define test(a) printf(hello#a)
#define testjj(a) printf(%d,a##_1)
int _tmain(int argc, _TCHAR* argv[])
{
test(c++sfsfs);
printf(
);
int x_1 = 1000;
testjj(x);
return 0;
}
helloc++
1000