The minute you decide to use new for a dynamic allocation,you adopt the following responsebilities:
只要你决定动态开辟内存空间,你就有活干了,下面的就是:
1 You must make sure that somebody will later delete the allocation.
你必须确保有哪个老几会把他在不用的时候删除,也许这个人就是你自己.
2 You must ensure that the correct form of delete is used.Only once deletion and for an array allocation,delete[] is required.
你必须确保它们被正确的删除,只能而且只能被删除一次,有时候还有一次性删除一个数组.
That's quite a set of responsebilities,and I can't understand why you'd want to adopt them if it wasn't necessary.
你要管一大堆屁事,我真是搞不懂在不是不需那样做的情况下你还屁颠屁颠的去使用它干吗?
Thanks to vector and string.It isn't necessary anywhere near as often as it used to be.
感谢vector,感谢string.它几乎总是必要的.
289



被折叠的 条评论
为什么被折叠?



