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

孟岩 myan at csdn.net
Wed Jul 12 15:29:59 CST 2006


把你崩溃的程序贴上来。

 

应该就是由于缺少copy constructor和copy assignment导致的问题而已。

 

  _____  

发件人: cpp-bounces at codingnow.com [mailto:cpp-bounces at codingnow.com] 代表 孙
华明
发送时间: 2006年7月10日 16:09
收件人: C++ Discuss Group
主题: Re: [cpp] 初次光临,请多指教

 

是啊怎么崩溃的?

没有内存泄露啊,好像也没有空指针访问啊。

----- Original Message ----- 

From: ling <mailto:xl-yc-lzj at necsoft.com.cn>  

To: C++ Discuss Group <mailto:cpp at codingnow.com>  

Sent: Monday, July 10, 2006 10:19 AM

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

 

今天看了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 */ }
};


  _____  


_______________________________________________
Cpp mailing list
Cpp at codingnow.com
http://codingnow.com/mailman/listinfo/cpp


  _____  

Confidentiality Notice: The information contained in this e-mail and any
accompanying attachment(s) is intended only for the use of the intended
recipient and may be confidential and/or privileged of Neusoft Group Ltd.,
its subsidiaries and/or its affiliates. If any reader of this communication
is not the intended recipient, unauthorized use, forwarding, printing,
storing, disclosure or copying is strictly prohibited, and may be unlawful.
If you have received this communication in error, please immediately notify
the sender by return e-mail, and delete the original message and all copies
from your system. Thank you. 
  _____  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codingnow.com/pipermail/cpp/attachments/20060712/37798e77/attachment.html


More information about the Cpp mailing list