![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 354 阅读 · 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 · 6627 阅读 · 0 评论 -
Linux - 创建与使用动态链接库
1.创建动态链接库hello.so: #include void hello(void) { printf("Hello, this is hello.so\n"); }$gcc -fpic -shared -o hello.so hello_so.c 2.使用动态链接库hello.so: #include #include #include int main(i原创 2012-08-16 10:05:56 · 1382 阅读 · 0 评论