#include<iostream>
using namespace std;
#define Conn(x,y) x##y //表示x连接y
#define tochar(x) #@x //给x加上单引号,结果返回是一个const char
#define tostring(x) #x //给x加双引号 返回char const *
void test01()
{
cout <<Conn(123,444) << endl; //123444
cout <<Conn("abc", "efg") << endl; //abcefg
auto a2 = tochar(4);
cout << a2 << endl; // a2='4'
cout <<typeid(a2).name() << endl;
auto a3 = tostring(43434);
cout << a3 << endl; //a3="43434"
cout << typeid(a3).name() << endl;
}
int main()
{
test01();
system("pause");
return 0;
}
06-08
765
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-20
3295
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)