中国开发网: 论坛: 程序员情感CBD: 贴子 65856
Yxd
复杂点就这样干吧。。。
char* AllocateString( unsigned int nSize )
{
nSize;// just make compiler happy
return NULL;
}
...
void ReleaseAllocator()
{
//...
}
...
typedef char* ( *New )( unsigned int );
typedef void ( *Release )();
struct StringAllocator
{
New allocate;
Release release;
};
...
struct StringAllocator theAllocator;
theAllocator.allocate = AllocateString;
theAllocator.release = ReleaseAllocator;
atexit( theAllocator.release );

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录