- #include <iostream>
- using namespace std;
-
- #define A(i) a##i
-
- int main()
- {
- int A(3) = 3;
- cout << a3 << endl; // 3
-
- return 0;
- }
但是, 下面这样不行:
- #include <iostream>
- using namespace std;
-
- int main()
- {
- int a##3 = 3;
- cout << a3 << endl;
-
- return 0;
- }