T
thomas
----------code-----------------------
#include<iostream>
using namespace std;
#define f(x,y) x##y
#define g(x) #x
#define h(x) g(x)
int main(){
cout<<g(f(1,2))<<endl;
cout<<h(f(1,2))<<endl;
}
---------------code----------------------
the result for g() and h() is different, why?
what's the rule for macro expansion?
#include<iostream>
using namespace std;
#define f(x,y) x##y
#define g(x) #x
#define h(x) g(x)
int main(){
cout<<g(f(1,2))<<endl;
cout<<h(f(1,2))<<endl;
}
---------------code----------------------
the result for g() and h() is different, why?
what's the rule for macro expansion?