源文件代码如下:

1 #include "stdafx.h"
2 using namespace std;
3 #include <iostream>
4 #define  T 1
5 #define ABC void main() \
6     {cout<<"hello!"<<<<endl;}
7 #include "abc.h"
8 

 

头文件代码如下:abc.h

1 #if T
2 char s[] = "good morning!";
3  ABC
4 #endif

 

替换后代码如下:

 

1 #include "stdafx.h"
2 using namespace std;
3 #include <iostream>
4 char s[] = "good morning!";
5 void main()
6  {
7     cout<<"hello!"<<<<endl;
8  }

 

 

执行后哦输出如下:

hello! good morning!

相关文章:

  • 2022-01-11
  • 2021-04-16
  • 2021-09-22
  • 2021-10-19
  • 2022-12-23
  • 2021-08-06
  • 2021-08-07
猜你喜欢
  • 2021-04-20
  • 2021-05-29
  • 2021-07-05
  • 2021-07-24
  • 2021-10-03
  • 2021-05-29
  • 2021-12-12
相关资源
相似解决方案