#define PI 3.1416
#define STRING(x) #x
#define STRING_PI STRING(PI)
void test()
{
string sPI = STRING_PI;
cout << sPI;
}
It outputs "PI" rather than 3.1416.
#define PI 3.1416
#define STRING(x) #x
#define STRING_PI STRING(PI)
void test()
{
string sPI = STRING_PI;
cout << sPI;
}
It outputs "PI" rather than 3.1416.