[cpp] 初次光临,请多指教

ling xl-yc-lzj at necsoft.com.cn
Mon Jul 10 10:19:14 CST 2006


今天看了c++对话系列,为什么说下面的类程序会因为内存问题而崩溃呢?

#include "xStruct.h" // definition of struct X

class xWrapper
{
    X* xItem;
public:
    xWrapper() : xItem(new X) { }
    ~xWrapper() { delete xItem; }

    void dump() { /* dumps xItem to cout */ }
};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codingnow.com/pipermail/cpp/attachments/20060710/082c8695/attachment.html


More information about the Cpp mailing list