#include
#include
#include
#include
#include
using namespace std;
#define maxn 100000
int n, m, x[maxn];
int Max;
bool judge(int d)
{
int cnt = 1;
int a = x[0];
for(int i=1; i<n; i...
分类:
其他好文 时间:
2015-04-15 17:03:27
阅读次数:
120
一.理论分析1.现实生活中,对一个设备除了能够读写之外,我们还希望能够对设备进行控制,比如说LED的亮灭,电机的转动等。2.一般希望能从应用程序传递命令给内核从而使得能够调用控制函数实现不同的控制。3.在用户空间,使用ioctl系统调用来控制设备:(应用程序接口)int ioctl(int fd,u...
分类:
其他好文 时间:
2015-04-15 17:01:48
阅读次数:
132
queue.h 1 #ifndef QUEUE_H 2 #define QUEUE_H 3 4 #include 5 #include 6 #include 7 8 //node 9 typedef struct QueueNode10 {11 int data;12 struc...
分类:
其他好文 时间:
2015-04-15 16:59:05
阅读次数:
186
class Program { public int[] shuchucanshu(int[] shu,out int a,out int b) //基本格式,定义一个int数组 { for (int i = 0; i < shu.Length ; i++) //冒泡排序 { for (int j ...
分类:
其他好文 时间:
2015-04-15 16:59:02
阅读次数:
134
1 #include 2 #include 3 4 char* UnicodeToAnsi( const wchar_t* szStr ) 5 { 6 int nLen = WideCharToMultiByte( CP_ACP, 0, szStr, -1, NULL, 0, N...
分类:
编程语言 时间:
2015-04-15 16:48:21
阅读次数:
200
#include#include#include#include #include#include #include #include #include //演示父子进程共享文件描述符//相当于2个fd指向同一块内存空间.//因为2个进程共享了文件指针偏移量,所以都能向文件中有序写数据int mai...
分类:
系统相关 时间:
2015-04-15 16:46:17
阅读次数:
158
#include#include#include#include #include#include int main(void){ printf("sfsdfsfd"); // 这里没有加\n //exit(0); _exit(0); // 打印不出来 return 0;...
分类:
其他好文 时间:
2015-04-15 16:46:13
阅读次数:
109
#include#include#include#include #include//fork进程//变量的引申 每一个进程有独立的进程地址空间有更深入的理解//写实复制理解// 1. 子进程修改变量时拷贝// 2. 只拷贝页 ----> Linux内核内存管理机制int main(void){.....
分类:
其他好文 时间:
2015-04-15 16:40:37
阅读次数:
105
对于普通类型的对象来说,它们之间的复制是很简单的,例如:int a=100;int b=a;而类对象与普通对象不同,类对象内部结构一般较为复杂,存在各种成员变量。下面看一个类对象拷贝的简单例子。#include using namespace std;class CA{ public: CA(in....
分类:
编程语言 时间:
2015-04-15 16:35:57
阅读次数:
161
stack.h 1 #ifndef _STACK_H 2 #define _STACK_H 3 4 #include 5 #include 6 7 typedef struct StackNode 8 { 9 int data;10 struct StackNode* next;...
分类:
其他好文 时间:
2015-04-15 16:31:42
阅读次数:
119