
apue
_暮落_
noobcoder
展开
-
关于位的算法
干脆把若干方法都贴过来吧~~~ Counting bits set (naive way) unsigned int v; // count the number of bits set in v unsigned int c; // c accumulates the total bits set in v for (c = 0; v; v >>= 1) { c +=转载 2013-07-18 00:44:22 · 1067 阅读 · 0 评论 -
文件复制(多进程实现-适合各种项目参考)
#include "apue.h" #define PATH "1.db" void sig_alrm(int signo) { printf("signo=%u pid=%u tid=%u \n", (unsigned int )signo, (unsigned int )getpid(), (unsigned int )pthread_self()); return原创 2013-08-07 19:34:17 · 1080 阅读 · 0 评论