
Programming Skills
chaosinux
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
do...while(0)的妙用
转载自:http://www.cnblogs.com/baiyanhuang/archive/2009/09/16/1730736.html在C++中,有三种类型的循环语句:for, while, 和do...while, 但是在一般应用中作循环时, 我们可能用for和while要多一些,do...while相对不受重视。但是,最近在读我们项目的代码时,却发现了do..转载 2012-08-08 18:17:54 · 388 阅读 · 0 评论 -
DJB hash function for strings
/* the famous DJB Hash Function for strings */unsigned int DJBHash(char *str){ unsigned int hash = 5381; while (*str){ hash = ((hash << 5) + hash) + (*str++); /* times 33 */ } hash &= ~(1 <<转载 2012-08-10 22:48:21 · 6677 阅读 · 0 评论 -
Linux - 创建与使用动态链接库
1.创建动态链接库hello.so:#include void hello(void){ printf("Hello, this is hello.so\n");}$gcc -fpic -shared -o hello.so hello_so.c2.使用动态链接库hello.so:#include #include #include int main(i原创 2012-08-16 10:05:56 · 1422 阅读 · 0 评论