#include <iostream>
#include <stdlib.h>
#define name_to_str(name)(#name)
int main()
{
int sum = 10;
std::cout<<name_to_str(sum)<<std::endl;//调用宏输出char*型“sum”
system("pause");
return 0;
}
#include <iostream>
#include <stdlib.h>
#define name_to_str(name)(#name)
int main()
{
int sum = 10;
std::cout<<name_to_str(sum)<<std::endl;//调用宏输出char*型“sum”
system("pause");
return 0;
}