【发布时间】:2018-03-20 09:44:47
【问题描述】:
我想通过字符串打印我的宏的值 给定代码
#include<iostream>
#define abc 7
using namespace std;
int main()
{
string str = "abc";
cout<<str<<endl;
}
如果我做 cout str,输出应该是 7
【问题讨论】:
-
既然宏只是被它们的值替换了,那么
cout<<abc<<endl; -
问题是 - 我将从文件中读取 str 值,并且该文件中会有多个宏