码迷,mamicode.com
首页 >  
搜索关键字:define    ( 25272个结果
自定义网络消息
#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
C语言const与define的使用
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
[Activator-HelloAkka] Define our Actors
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
【HDOJ】1466 计算直线的交点数
找了个规律。 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
c++ new失败后做了什么?
一直以来我都在写着这样的代码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
【HDOJ】1422 重温世界杯
简单题。 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
【HDOJ】1421 搬寝室
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
链表中的指针运用(利用2个例子来说明)
示例代码注重这里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
AMD 规范以及如何将AMD转变为CommonJS
原文: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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!