/**
* UDP 协议无关 调用 getaddrinfo 和 udp_server
**/
#include "unp.h"
#include
int
main(int argc, char **argv)
{
int sockfd;
ssize_t n;
char buff[MAXLINE];
time_t ticks;
socklen_t len;
struct sockaddr_storage cliaddr;
//1.利用 Udp_s...
分类:
其他好文 时间:
2014-08-24 23:56:33
阅读次数:
462
题目:给出n个数(n 2 #include 3 #include 4 using namespace std; 5 const int maxn = 1000005; 6 struct node 7 { 8 int value; 9 int index;10 }que[maxn]...
分类:
其他好文 时间:
2014-08-24 23:44:23
阅读次数:
330
看了unix环境高级编程第三章,把代码也都自己敲了一遍,另主要讲解了一些IO函数,read/write/fseek/fcntl;这里主要是c函数,比较容易,看多了就熟悉了。对fcntl函数讲解比较到位,它可以得到和改变打开文件的属性(只读,只写等等,注意后面和stat区别),下面记录了自己在学习.....
分类:
其他好文 时间:
2014-08-24 22:09:33
阅读次数:
291
Q1:为什么需要委托?为了解决C#中没有指针函数的缺陷有了委托可以实现对函数的调用。Q2:委托怎么理解?首先用delegate关键字声明一个函数,这个函数就叫做委托。委托使用需要实例化,他是一个引用类型。他作为函数可以封装方法。Q3:怎么用?delegate int dele(int k);stat...
分类:
其他好文 时间:
2014-08-24 19:22:42
阅读次数:
153
#include #include #include using namespace std;struct cwd{ int a; void (*add)(int , int );};void pluss(int a , int b){ int c=a+b; cout<<c...
分类:
其他好文 时间:
2014-08-24 18:01:32
阅读次数:
195
栈
栈类似于箱子。
静态栈、动态栈。
关于栈的操作
#include
#include
#include
typedef struct Node
{
int data;
struct Node *pNext;
}NODE, *PNODE;
typedef struct Stack
{
PNODE pTop;
PNODE pBottom;
}STACK, *PSTACK;
...
分类:
其他好文 时间:
2014-08-24 16:45:42
阅读次数:
179
024.链表的创建和链表遍历的算法演示
#include
#include
#include
typedef struct Node
{
int data;
struct Node *pNext;
}NODE, *PNODE; //NODE 等价于struct Node, PNODE 等价于struct Node *
//函数声明
PNODE create_list(void);
...
分类:
其他好文 时间:
2014-08-24 15:30:32
阅读次数:
175
#include
#include
#include
#include
#include
#include
#include
#define DRIVERNAME "xxx"
#define DEV_MINOR 0
static dev_t xxx_devno = 0;
static struct class * xxx_class;
struct xxx_dev
{
st...
分类:
系统相关 时间:
2014-08-24 14:13:02
阅读次数:
298
他妈的。气死我了试试这里的代码功能如何。#ifndef _PAGE_CLASS_#define _PAGE_CLASS_#include #include using namespace std;typedef struct{ string text;}Display;typedef void...
分类:
其他好文 时间:
2014-08-24 14:09:52
阅读次数:
160
获取文件属性信息,在终端下可以直接利用ls- l命令,在编程时,用到以下三个函数:
#include
#include
#include
int stat(const char *file_name, struct stat *buf);
函数说明: 通过文件名filename获取文件信息,并保存在buf所指的结构体stat中
返回值: 执行成功则返回0...
分类:
其他好文 时间:
2014-08-24 13:00:22
阅读次数:
233