摘要: static_cast<void(*)(int&)>(f)(x);去调用引用版本 阅读全文
posted @ 2017-12-11 14:51 杏坛sky 阅读(88) 评论(0) 推荐(0)
摘要: 冒泡 时间复杂度 n*(n-1)/2 空间复杂度 1; void sortint(int * a, int count) { for(int top = 0;top <count;top ++) for(int seek = top +1;seek <count;seek++) if(*(a+top 阅读全文
posted @ 2017-12-11 14:51 杏坛sky 阅读(184) 评论(0) 推荐(0)
摘要: 进程 进程号一般不重复使用 空闲进程 pid 0 ,内核运行的第一个进程 init pid 1. 内核搜索init的顺序,如果找不到,内核就会发出panic挂起 /sbin/init /etc/init /bin/etc /bin/sh 进程号最大值32768 老unix用16位计算pid,可以在/ 阅读全文
posted @ 2017-11-17 18:13 杏坛sky 阅读(205) 评论(0) 推荐(0)
摘要: Fileio 1.open() 系统调用 头文件 #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> 原型 int open(const char * name,int flags); int open(const char 阅读全文
posted @ 2017-11-16 15:00 杏坛sky 阅读(255) 评论(0) 推荐(0)