有没有好的内存碎片分析器?(linux gcc版本会很好).Valgrind无法对此进行分析,因为它使用自定义malloc/free函数.
谢谢,安德鲁
有没有办法在c中进行字符串化之前评估表达式?
例:
#define stringify(x) #x
...
const char * thestring = stringify( 10 * 50 );
Run Code Online (Sandbox Code Playgroud)
问题是我想得到
const char * thestring = "500";
Run Code Online (Sandbox Code Playgroud)
而不是:
const char * thestring = "10 * 50";
Run Code Online (Sandbox Code Playgroud)
可以这样做吗?
是否可以在预处理器宏中对字符进行字符串化,而不包括(')s
例:
#define S(name, chr) const char * name = #name chr
Run Code Online (Sandbox Code Playgroud)
用法:
S(hello, 'W'); //should expand to 'const char * hello = "helloW"
Run Code Online (Sandbox Code Playgroud)
谢谢你!安德鲁