小编And*_*rew的帖子

内存碎片分析器

有没有好的内存碎片分析器?(linux gcc版本会很好).Valgrind无法对此进行分析,因为它使用自定义malloc/free函数.

谢谢,安德鲁

c c++ memory-management heap-fragmentation

20
推荐指数
2
解决办法
7849
查看次数

如何在C中字符串化表达式

有没有办法在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)

可以这样做吗?

c

8
推荐指数
2
解决办法
7285
查看次数

字符串的预处理程序字符串

是否可以在预处理器宏中对字符进行字符串化,而不包括(')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)

谢谢你!安德鲁

c c++

1
推荐指数
2
解决办法
150
查看次数

标签 统计

c ×3

c++ ×2

heap-fragmentation ×1

memory-management ×1