酒鬼z

我自将心向明月,独卧沙场醉圆缺

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

文章分类 -  STL

摘要:原文地址:http://blog.csdn.net/factor2000/article/details/3936195// //alg_std::sort.cpp//#include #include #include // For greater( )#include using namespace std;// Return whether first element is greater than the secondbool UDgreater ( int elem1, int elem2 ){return elem1 > elem2;}class Csort{public:/ 阅读全文
posted @ 2013-12-04 13:27 酒鬼z 阅读(2184) 评论(0) 推荐(0)

摘要:网上江湖郎中和蒙古大夫很多,因此,此类帖子也很多。关于排序,我还真没研究过,看了江湖郎中和蒙古大夫的帖子,搞了半天不行,所以,自己研究了一 下,如下:三种方式都可以,如重写index,t2->index);returnt1->indexindex;}booloperatorindex,t2->index);returnt1->indexindex;}intmain(intargc,char**argv){listtiList1;listtiList2;vectortiVec1;vectortiVec2;TestIndex*t1=newTestIndex(2);TestI 阅读全文
posted @ 2013-07-29 13:52 酒鬼z 阅读(361) 评论(0) 推荐(0)

摘要:在程序中常常需要处理字符串,除了以前写的一些关于char的方法的总结外,很多的时候也会用到string来进行字符串处理。下面对它的常用方法做些总结:1、定义:string &operator=(const string &s);//把字符串s赋给当前字符串string &assign(const char *s);//用c类型字符串s赋值string &assign(const char *s,int n);//用c字符串s开始的n个字符赋值string &assign(const string &s);//把字符串s赋给当前字符串string 阅读全文
posted @ 2013-05-09 19:51 酒鬼z 阅读(195) 评论(0) 推荐(0)