# —— 字符串
##——连接两个参数
##——连接两个参数
#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;
}
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;
}