
嵌入式Linux程序设计
派生阳光
醒悟的不算晚,再大的坎也要迈过,奋斗努力无止境。
展开
-
求100之内的素数,定义函数,按照.h,.c形式整理源文件
/*This file contents 'Main' function*/#include #include void judge(){int i,k,x;for(x = 2;x{ k = sqrt(x);for(i=2;iif(x%i==0)break;if(i>k) printf("%d\t",x);}原创 2014-12-17 10:17:50 · 765 阅读 · 0 评论 -
反向输出一个链表(链表逆置)
/*This file was made for Link_list Exp on LinuxMain.cpp Founded in others' Blog ,Thanks for sharing your knowledge*/#include using namespace std;class node{ public:转载 2014-12-17 10:27:43 · 2271 阅读 · 0 评论 -
Linux下创建共享内存和测试
/*This is shdata.hFounded In Others's Blog. Thanks For Sharing Your Knowledge*/#ifndef _SHMDATA_H_HEADER #define _SHMDATA_H_HEADER #define TEXT_SZ 2048 struct shared_use_s转载 2014-12-17 10:33:30 · 778 阅读 · 0 评论 -
编写程序对N个元素数组,用冒泡排序法进行排序
/*This file is used for Exp6_1,Bubble sortingWritten by Namer_Mega, Thanks for sharing your knowledge.*/#includevoid sorting(int a[],int n){int j,i,temp,k;for(j = 0;jfor(i =原创 2014-12-17 10:21:28 · 11594 阅读 · 0 评论 -
求1+2!+3!+...+20!的和,使用函数实现
// factorial.cpp : 定义控制台应用程序的入口点。/*Main.cppWritten By Namer_Mega ,Thanks for sharing your knowledge*/#include using namespace std;int factorial(int x){int product = 1,k;i原创 2014-12-17 10:31:04 · 1559 阅读 · 0 评论 -
编写守护进程,并使用守护进程按要求生成.log文件
1.编写一守护进程,每隔30秒,将系统当前进程总数、休眠进程数、运行进程数、僵死进程数、终止进程数等信息按照如下格式写入到procinfo.log文件中。格式可类似为:2013-11-10 20:50:2029 processes: 28 sleeping, 1 running, 0 zombie, 0 stopped2013-11-10 20:50:5029 proces原创 2014-12-17 10:55:14 · 2162 阅读 · 0 评论