C++要仔细manage resources, 比如memory, file, connection

回答: 一个c++的技术问题,请各位指点....澳洲老土2007-11-13 22:23:04

如果这些东西是class memeber,你就要自己implement copy constructor, = and destructor。通常是一起来的。C#因为有garbage collection这些东西简单些,养成用完的object = null,connection, file, stream 等都主动去close就好了。

所有跟帖: 

非常实用, thanks. -fearcpatest- 给 fearcpatest 发送悄悄话 (0 bytes) () 11/14/2007 postreply 10:15:42

请您先登陆,再发跟帖!