上一页 1 ··· 158 159 160 161 162 163 164 165 166 ··· 168 下一页
摘要: 10.2.1 STL的string1String概念² string是STL的字符串类型,通常用来表示字符串。而在使用string之前,字符串通常是用char*表示的。string与char*都可以用来表示字符串,那么二者有什么区别呢。string和char*的比较c语言没有字符串,使用字符数组模拟... 阅读全文
posted @ 2015-09-04 09:55 无天666 阅读(277) 评论(0) 推荐(0)
摘要: 10.1.2.2容器的分类序列式容器(Sequence containers)每个元素都有固定位置--取决于插入时机和地点,和元素值无关。vector、deque、list 关联式容器(Associated containers)元素位置取决于特定的排序准则,和插入顺序无关set、multiset、... 阅读全文
posted @ 2015-09-04 09:30 无天666 阅读(255) 评论(0) 推荐(0)
摘要: C/C++结构体的区别C中的结构体和C++中结构体的不同之处:在C中的结构体只能自定义数据类型,结构体中不允许有函数,而C++中的结构体可以加入成员函数。C++中的结构体和类的异同:一、相同之处:结构体中可以包含函数;也可以定义public、private、protected数据成员;定义了结构体之... 阅读全文
posted @ 2015-09-02 15:02 无天666 阅读(3046) 评论(0) 推荐(0)
摘要: int a = 1;const int* p1 = &a; // p1指向的内容不可改变int* const p2 = &a; // p2指向的位置不可改变*p1 = 2; // 错误!!++p2; // 错误!!结论:声明带const的指针时,const出现在*号左边则该指针指向的位置的内容不可改... 阅读全文
posted @ 2015-09-02 11:24 无天666 阅读(175) 评论(0) 推荐(0)
摘要: 内联函数:(1) 内联函数定义和作用:将一个函数声明为inline,那么函数就成为内联函数。内联函数通常就是它在程序中每个调用点上“内联地”展开。从定义上看,内联函数跟一般函数不一样,一般函数调用的时候是需要调用开销的(比如出栈入栈等操作),内联函数从定义上看更像是宏,但是跟宏不一样。内... 阅读全文
posted @ 2015-09-02 10:16 无天666 阅读(1278) 评论(0) 推荐(0)
摘要: #include using namespace std;template class MyVector{ friend ostream & operator(ostream &out, const MyVector &obj);public: MyVector(int size = ... 阅读全文
posted @ 2015-09-01 23:04 无天666 阅读(812) 评论(0) 推荐(0)
摘要: #define _CRT_SECURE_NO_WARNINGS #include #include #include typedef struct Node{ int data; struct Node *next;}SLIST;SLIST *SList_Create(); //创建链... 阅读全文
posted @ 2015-08-29 18:13 无天666 阅读(312) 评论(0) 推荐(0)
摘要: /********************************************************* * des.h * 用户使用des算法头文件 * *********************************************************/#i... 阅读全文
posted @ 2015-08-29 00:36 无天666 阅读(3315) 评论(0) 推荐(1)
摘要: #ifndef __CFG_OP_H__#define __CFG_OP_H__#ifdef __cplusplusextern "C" {#endif//获取配置项int GetCfgItem(char *pFileName /*in*/, char *pKey /*in*/, char * p... 阅读全文
posted @ 2015-08-28 23:17 无天666 阅读(3092) 评论(0) 推荐(0)
摘要: // 3. 判断两个树是否互相镜像 public static boolean isMirrorRec(TreeNode r1, TreeNode r2){ // 如果两个树都是空树,则返回true if(r1==null && r2==null){ ... 阅读全文
posted @ 2015-05-28 19:44 无天666 阅读(348) 评论(0) 推荐(0)
上一页 1 ··· 158 159 160 161 162 163 164 165 166 ··· 168 下一页