摘要:copy from:http://www.cppblog.com/cxiaojia/archive/2012/07/31/185760.html 基本数据结构:链表(list) 谈到链表之前,先说一下线性表。线性表是最基本、最简单、也是最常用的一种数据结构。线性表中数据元素之间的关系是一对一的关系,
阅读全文
03 2017 档案
摘要://比较字符串s1和s2的前n个字节是否相等 int bcmp(const void* s1,const void*s2,int n); //将字符串src的前n个字节复制到dest中 void bcopy(const void *src,void *dest,int n); //设置字节字符串s的
阅读全文
摘要:因为C++支持两种字符串,即常规的ANSI编码(使用“”包裹)和Unicode编码(使用L“”包裹) 字符串处理函数,比如strlen和wcslen #ifdefine _UNICODE #define TCHAR wchar_t #endif -tcslen = strlen #ifndefine
阅读全文
摘要:/****/ //求两个int值得最大值 inline int const& max(int const& a,int const& b) { return a<b?b:a; } //求两个任意类型值中的最大值 template <typename T> inline T const& max(T
阅读全文
摘要://file max.hpp template <typename T> //template<class T> inline T const& max (T const& a,T const& b) { return a<b?b:a; } //file max.cpp #include <iost
阅读全文
摘要:1:check version gcc -v / g++ -v 2:compile gcc *.c / g++ *.cpp outfile: a.out 3:excute ./a.out 4:show excute time time ./a.out 5:change the after compi
阅读全文
摘要:int p; int *p; int p[3]; int *p[3];分析方式:首先从P开始分析,先与[]结合因为其优先级比*高,所以p是一个数组,然后再与*结合,说明数组里的元素是指针类型,然后再与int结合,说明指针所指向的内容的类型是整形的,所以P是一个由返回整形数据的指针所组成的数组。 in
阅读全文