C/C++
asongnic
这个作者很懒,什么都没留下…
展开
-
cv-qualified and cv-unqualified
a cv-qualified type is the “const”, “volatile” or “const volatile” version of a type. that is, a variable, function, etc. declared without one of those is cv-unqualified, while the addition of one of原创 2009-09-19 23:42:00 · 1612 阅读 · 0 评论 -
排序
#pragma once#include#include#includetypedef int KeyType;typedef struct { KeyType key;// 仅仅表示 是可以比较 排序的 // other } Comparable, *ComparablePtr;// 工具函数---交换 void swap(Compa原创 2009-09-28 23:57:00 · 347 阅读 · 0 评论 -
只有静态常量整型数据成员才能在类定义中初始化
下面这段代码是正确的#includeusing namespace std;//可以在类的声明中对静态常量整型的数据成员进行初始化class myclass{public: static const int i=20;};int main(){ cout<<myclass::i<<endl; return 0;} 下面这段代码是错误的:原创 2009-10-04 12:02:00 · 4179 阅读 · 0 评论 -
KMP算法
今天看了http://blog.csdn.net/chrython/archive/2006/10/05/1321894.aspx 中关于KMP算法的讨论,该文写得很好,感觉有些地方没有说明白 ,因此写下该文中没有说明白的地方. KMP 算法: KMP算法主要使用了一个模式串的next数组用来指定当模式不匹配时模式串应该回到的索引位置 数组大小为模式串的长度(strlen)原创 2009-10-01 15:35:00 · 510 阅读 · 0 评论