#define MSG_HEAD_LEN 4//消息头部结构typedef struct tagMsg
{ //消息类型 u16 type; //消息体长度 u16 length;}TMsg;void receive(SOCKET s){ char
buffer[1024*28]; //CServM...
分类:
其他好文 时间:
2014-06-06 11:25:33
阅读次数:
243
const是一个C语言的关键字,它限定一个变量不允许被改变。使用const在一定程度上可以提高程序的健壮性,另外,在观看别人代码的时候,清晰理解const所起的作用,对理解对方的程序也有一些帮助。
虽然这听起来很简单,但实际上,const的使用也是c语言中一个比较微妙的地方,微妙在何处呢?请看下面....
分类:
编程语言 时间:
2014-06-06 11:05:48
阅读次数:
333
继上一篇堆排序之后,用相同的数据结构写了个快速排序和插入排序,当数组的长度较小的时候,可使用插入排序,实现如下:QuickSort.h 1 #ifndef
__QUICKSORT 2 #define __QUICKSORT 3 #include "MySqList.h" 4 #include "In...
分类:
其他好文 时间:
2014-06-06 10:50:30
阅读次数:
282
The Actor is the unit of execution in Akka.
Actors are object-oriented in the sense that they encapsulate state and
behavior, but they have much stron...
分类:
其他好文 时间:
2014-06-06 10:37:41
阅读次数:
344
找了个规律。 1 #include 2 #include 3 #include 4 5
#define MAXN 21 6 7 int buf[MAXN][150]; 8 int lens[MAXN]; 9 10 int comp(const
void *a, const void *b)...
分类:
其他好文 时间:
2014-06-05 21:46:14
阅读次数:
218
一直以来我都在写着这样的代码char* buf = new
char[1024];if(NULL == buf){ printf("new
failure\n");}可new失败以后真的会返回NULL吗?写了个例子测试一下:#include #include #define BUF_SIZE ...
分类:
编程语言 时间:
2014-06-05 20:12:11
阅读次数:
331
简单题。 1 #include 2 3 #define MAXN 100005 4 5 int
wi[MAXN], li[MAXN]; 6 int diff[MAXN=0 || total+diff[i]>=0) {20 total +=
diff[i];21 ...
分类:
其他好文 时间:
2014-06-05 20:08:55
阅读次数:
355
DP。这题都能TLE,发现memset有时居然比for还要慢。 1 #include 2
#include 3 #include 4 5 #define MAXN 2005 6 #define INF 0x3fffffff 7 int
dp[MAXN][MAXN]; 8 int buf[M...
分类:
其他好文 时间:
2014-06-05 20:01:32
阅读次数:
381
示例代码注重这里p1的作用以下代码是用尾插法添加结点#include #include #define
N sizeof (STU)typedef struct stu{ int num; char name[20];} STU, * PSTU;PSTU
creat (PSTU head) ...
分类:
其他好文 时间:
2014-06-05 19:49:50
阅读次数:
351
原文:http://villadora.me/2014/05/23/amd-define-and-how-to-translate-amd-to-commonjs/CommonJS和AMD的争论已经有很多,而两者也在项目进化和融合。个人看来CommonJS更面向于开发者,对于开发者来说,需要的是清晰...
分类:
Web程序 时间:
2014-06-05 19:02:57
阅读次数:
384