#include<iostream>
#include<stdlib.h>
#include<string>
#include<windows.h>
using namespace std;
#define STR(s) (#s)
#define STR1(a,b) (a##e##b)
int main(void)
{
cout<<STR(hello)<<endl;
cout<<STR1(3,4)<<endl;
return 0;
}
//调用顺序类似于栈。
//先注册的后调用
#include<stdlib.h>
#include<string>
#include<windows.h>
using namespace std;
#define STR(s) (#s)
#define STR1(a,b) (a##e##b)
int main(void)
{
cout<<STR(hello)<<endl;
cout<<STR1(3,4)<<endl;
return 0;
}
//调用顺序类似于栈。
//先注册的后调用
本文展示了一个简单的C++程序,使用了预处理器指令来输出字符串。通过宏定义STR和STR1展示了如何在编译阶段生成特定的字符串。
389

被折叠的 条评论
为什么被折叠?



