
STL (C++ Standard Template Library)
文章平均质量分 74
begges
喜欢编程,玩儿,学习,运动。
展开
-
string 类返回常量字符串常量的对与错
函数内的常量字符串是从程序静态存储区域分配的。内存在程序编译的时候就已经分配好了,和全局变量和static变量的分配方式是一样的。那么请看下面程序: #include #include using namespace std; class baidu_url { public: static string index() { return "www.baidu.com"; } static const string & index1() { return "www.baidu.co原创 2010-08-03 22:16:00 · 875 阅读 · 0 评论 -
vector的iterator的错误使用
原文如下:(摘自>)7.2.6 The Increment and Decrement Problem of Vector IteratorsThe use of the increment and decrement operators of iterators includes a strange problem. In general, you can increment and decrement temporary iterators. However, for vectors and s原创 2010-11-04 16:11:00 · 8408 阅读 · 0 评论