6、宏组合 #和##
先上一段代码:
#include "stdafx.h"
#include<iostream>
using namespace std;
#define s5(a) Connect_##a
#define s(p) #p
void Connect_Test(const char* p)
{
cout << "this is Connect Test:" << endl;
cout << p << endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
s5(Test)("hello owrld");
cout << "******************************************************" << endl;
cout << s(p)<< endl;
return 0;
}
上述代码的输出结果如下: