This allows you to convert any preprocessor macro value to a string, e.g. for printing.
#include <iostream>
#define MEINMAKRO 1.3.4
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
int main()
{
std::cout << TOSTRING(MEINMAKRO) << std::endl;
return 0;
}
you may also be interested in ##, from the TowerMadness source:
#define ADD_PROFILE( name )
static pProfiler profiler_##name;
ADD_PROFILE(render,game);
translates to
static pProfiler profiler_render;
Cool, thanks for the hint.