我想使用宏将字符串常量转换为预处理令牌.例:
// get the first character of marco argument to postfix of new data type.
#define TYPE(typename) Prefix ## typename #typename[0]
void main()
{
TYPE(int) a, b, c; // Prefixinti a, b, c;
TYPE(float) x, y, z; // Prefixfloatf x, y, z;
a = 3;
}
在C/C++中有可能吗?
p/s:抱歉我的英语不好.
编辑
在一些图像处理过滤器中,我看到图像从空间域转换到频域.我的问题是:为什么我们这样做?空间域中的图像与频域中的图像有何不同?