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.它几乎总是必要的.
分享到:
相关推荐
SGI STL之vector源码,带注释
STL vector 知识详解 STL vector 知识详解 STL vector 知识详解 STL vector 知识详解 STL vector 知识详解
title: STL中的vector string总结vector在C++编程中经常会被使用。初始化// 类似于数组的方式//使用构造函数的方式。
使用VC++控制台应用程序编写,测试了:vector对象的排序,对象中的大小无序,有重复。
详细讲解了STL中vector容器的用法.
c++的STL的vector的一个实现。使用了c++11的大部分特性,包含vector的几乎所有功能。仅作学习之用。
STL中vector、list、deque和map的区别
STL中的string介绍,以及如何合起来使用的方法
很全的STL string类的函数方法,便于查询
vector list map pair stl 标准模板库 c++ 程序示例
C++实现STL容器之Vector
c++ STL source code, hash and vector etc
非常实用的STL容器讲解学习,内容全,讲解详细 包括Vector、Vector、String、Deque、sort、set、map,绝对有用!!
每个Timer的对象有一个编号(可以是一个无符号的long或 short),以方便在全局中区分每个Timer对象。 基类提供一个纯虚函数GetTimerID 来取得Timer的编号。
包含常用stl string的常用函数
仿写C++ STL标准库 vector 源码,可直接在cpp文件中调用实现
stl几个(set map vector string)用法,c++ stl 学习资料
使用STL中的VECTOR LIST 容器实现学生管理系统,代码实现增删差改
《STL系列》之vector原理及实现
STL -容器,string容器