摘要: 转载请注明出处!本文连接及作者。不得用于商业用途!http://hi.baidu.com/quantumcloud/blog/item/9156a6c584996c179c163d5b.htmlBY:aiminickwong最近我遇到很多朋友在问我vmware workstation 版本虚拟机的上... 阅读全文
posted @ 2013-02-20 14:36 eagleGeek 阅读(193) 评论(0) 推荐(0) 编辑
摘要: (1)在本机上登录字符界面或者X11图形界面均为tty终端(2)通过telnet/ssh远程登录或者在X11中生成一个XTERM的终端,均为虚拟终端PTS。如:[lujinhong@localhost ~]$ wholujinhong tty2 2013-02-18 22:47ora... 阅读全文
posted @ 2013-02-19 15:15 eagleGeek 阅读(510) 评论(0) 推荐(0) 编辑
摘要: 参考自《Linux程序设计》第二版 P137#include #include #include #include int main(void){ FILE *pfile; pfile = fopen("/home/kkk", "r"); if(!pfile){ ... 阅读全文
posted @ 2013-02-18 22:59 eagleGeek 阅读(267) 评论(0) 推荐(0) 编辑
摘要: error是一个包含在中的预定义的外部int变量,用于表示最近一个函数调用是否产生了错误。若为0,则无错误,其它值均表示一类错误。perror()和strerrot()函数可以把errno的值转化为有意义的字符输出。#include #include #include #include #inclu... 阅读全文
posted @ 2013-02-18 21:49 eagleGeek 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 参考《Linux程序设计》第二版P103扫描目录:#include #include #include #include #include #include #include void printdir(char *dir, int depth);int main(void){ printf(... 阅读全文
posted @ 2013-02-18 16:44 eagleGeek 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 使用read, write, scanf, printf等系统调用或库函数,可以实现简单的文件复制程序,但效率上有明显差别。方法一:逐个字符读入并输出#include #include #include #include #include #include int main(void){ ch... 阅读全文
posted @ 2013-02-17 21:20 eagleGeek 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 目录:1. Linux系统调用原理2. 系统调用的实现3. Linux系统调用分类及列表4.系统调用、用户编程接口(API)、系统命令和内核函数的关系5. Linux系统调用实例6. Linux自定义系统调用1.系统调用原理系统调用,顾名思义,说的是操作系统提供给用户程序调用的一组“特殊”接口。用户... 阅读全文
posted @ 2013-02-16 15:30 eagleGeek 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 1、当指针指向数组元素时,C语言允许对指针进行数值运算,支持并且只支持以下三种运算(1)指针加上一个整数(2)指针减去一个整数(3)两个指针相减2、两个指针的比较p1=&a[1];p2=&a[2];则p2>p13、若数组有N个元素,则虽然a[N]不存在,但经常使用for(int *p=&a[0]; ... 阅读全文
posted @ 2013-02-11 20:14 eagleGeek 阅读(130) 评论(0) 推荐(0) 编辑
摘要: (1)在C语言的被调用函数中,没有办法求出数组实参的大小,因此需要显示传递array_length参数。详见博客:C语言内存分配时间。(2)以O(N)的计算时间得出结果。#include void find_2_largest(int array[], int array_length, int *... 阅读全文
posted @ 2013-02-11 19:52 eagleGeek 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 只有以下三种情况:(1)数组是形式参数(2)数组声明的同时进行了初始化(3)数组的存储类型为extern参考自:《C语言程序设计:现代方法》P334 阅读全文
posted @ 2013-02-11 11:03 eagleGeek 阅读(1747) 评论(0) 推荐(0) 编辑