# —— 字符串
##——连接两个参数
#include <iostream>
using namespace std;

#define TEST(pid) (cout<<para##pid<<endl);
#define TEST2(p) (cout<<#p<<endl);
int main()
{
    
int para3 = 3;
    
int para2 = 2;
    TEST(
2);    //<==>cout<<para2<<endl;
    TEST(3);    //<==>cout<<para3<<endl;

    TEST2(test)        
//<==>cout<<"test"<<endl;
    TEST2("test2");    //<==>cout<<""test2""<<endl;
    system("pause");
    
return 0;
}

 
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐