嵌入式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;i if(x%i==0) break; if(i>k) printf("%d\t",x); }原创 2014-12-17 10:17:50 · 731 阅读 · 0 评论 -
反向输出一个链表(链表逆置)
/* This file was made for Link_list Exp on Linux Main.cpp Founded in others' Blog ,Thanks for sharing your knowledge */ #include using namespace std; class node { public:转载 2014-12-17 10:27:43 · 2210 阅读 · 0 评论 -
Linux下创建共享内存和测试
/* This is shdata.h Founded 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 · 698 阅读 · 0 评论 -
编写程序对N个元素数组,用冒泡排序法进行排序
/* This file is used for Exp6_1,Bubble sorting Written by Namer_Mega, Thanks for sharing your knowledge. */ #include void sorting(int a[],int n) { int j,i,temp,k; for(j = 0;j for(i =原创 2014-12-17 10:21:28 · 11422 阅读 · 0 评论 -
求1+2!+3!+...+20!的和,使用函数实现
// factorial.cpp : 定义控制台应用程序的入口点。 /* Main.cpp Written 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 · 1462 阅读 · 0 评论 -
编写守护进程,并使用守护进程按要求生成.log文件
1.编写一守护进程,每隔30秒,将系统当前进程总数、休眠进程数、运行进程数、僵死进程数、终止进程数等信息按照如下格式写入到procinfo.log文件中。 格式可类似为: 2013-11-10 20:50:20 29 processes: 28 sleeping, 1 running, 0 zombie, 0 stopped 2013-11-10 20:50:50 29 proces原创 2014-12-17 10:55:14 · 2104 阅读 · 0 评论