由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [合集] 一道C++ class 设计题,请点评答案
相关主题
C++ deleteone question about operator delete
问个C++中重复删除指针的问题请教 C++的一个困惑 (operator delete)
one question about overloading operator deleteC++弱问
C++求助: New/Delete in Multidimensioned array请问delete的问题
C++ pointer problemC++高手请进,内存管理问题
请教一个C++有关的编译问题请求帮助 a C++/C question
one question about delete in c++[合集] C++ delete[]
delete[]的设计很不好[合集] C++ simple question
相关话题的讨论汇总
话题: chunks话题: memory话题: class话题: 点评话题: 一道
进入Programming版参与讨论
1 (共1页)
I*******e
发帖数: 1879
1
☆─────────────────────────────────────☆
st09 (st09) 于 (Tue Jun 9 22:11:14 2009, 美东) 提到:
做了一道笔试题,下面是和我的答案如下,请点评一下.
There are situations when a program frequently allocates variables of the
same type from the heap and deletes them after processing. To avoid costly
memory allocation, design and implement a class that returns chunks of
memory of the size of the variable and accepts those chunks of memory back
for further reuse.
Example:

class MemPool
{

public:
void
1 (共1页)
进入Programming版参与讨论
相关主题
[合集] C++ simple questionC++ pointer problem
请教一下,exception时,destructor一定会被调用么?请教一个C++有关的编译问题
Find and delete folder in C++one question about delete in c++
heap 和 stack问题delete[]的设计很不好
C++ deleteone question about operator delete
问个C++中重复删除指针的问题请教 C++的一个困惑 (operator delete)
one question about overloading operator deleteC++弱问
C++求助: New/Delete in Multidimensioned array请问delete的问题
相关话题的讨论汇总
话题: chunks话题: memory话题: class话题: 点评话题: 一道