定义LCD相应寄存器的结构体struct lcd_regs { unsigned long lcdcon1; unsigned long lcdcon2; unsigned long lcdcon3; unsigned long lcd...
分类:
其他好文 时间:
2014-07-01 19:12:25
阅读次数:
204
根据朋友给的一份原理写的 感觉还挺清楚#include "cv.h"#include "highgui.h"#include using namespace cv;#define MAXWIDTH 352#define MAXHEIGHT 288typedef struct PTNode{ ...
分类:
其他好文 时间:
2014-07-01 18:41:35
阅读次数:
145
structDemo1# include # include enum EType{ One = 1,Tow,Three };struct S1{ int id ; char name [111]; long version ;};int main(void){ ET...
分类:
其他好文 时间:
2014-07-01 17:16:06
阅读次数:
151
链表节点定义如下:1 typedef struct ListNode2 {3 int value;4 ListNode *next;5 }TListNode;众所周知,链表打印时从头到尾很简单,所以我们首先想到的可能是先把链表逆序,然后从头到尾再打印出来即可,但是逆序会破坏链表的结构...
分类:
其他好文 时间:
2014-07-01 11:54:59
阅读次数:
168
OVS中流表操作的理解关键在于这里哈希表的实现,引入的 flex_array方便了内存的管理,通过 hash&(桶数-1)可以随机的将一个元素定位到某一个桶中。
接下来是代码细节。
一. 核心数据结构
//流表
struct flow_table
{
struct flex_array
* buckets; //具体的流表项
unsigned...
分类:
其他好文 时间:
2014-07-01 11:09:12
阅读次数:
638
题目描述:
输入一个链表的头结点,从尾到头反过来打印出每个结点的值。链表结点定义如下:
struct ListNode{
int
m_nKey;
ListNode *m_pNext;
};
分析描述:
对于链表,如果是从头到尾的打印出链表是比较容易,但如果是从尾到头返过来打印每个结点的值就比较复杂。反序输出就是第一个遍历到的结点最后一个输出,而最后一个遍历的结点第一个输出。...
分类:
其他好文 时间:
2014-07-01 10:59:13
阅读次数:
163
分三块来讲述: 1 首先://注意在C和C++里不同 在C中定义一个结构体类型要用typedef: typedef struct Student { int a; }Stu; 于是在声明变量的时候就可:Stu stu1;(如果没有typedef就必须用struc...
分类:
其他好文 时间:
2014-07-01 10:32:38
阅读次数:
132
下面这个散列表的实现来自K&R,很经典。在其他场景中遇到的实现更复杂,基本原理不变,只是在hash算法,或者在快速查询上做了优化。
#include
#include
//具有相同hash值构成的链表
struct nlist{
struct nlist
* next;
char * name; //key-定义的名字
char ...
分类:
其他好文 时间:
2014-07-01 07:42:51
阅读次数:
158
#include
#include
#define MAX_MSG_BUF_LEN 512
int iKey = 6004;
struct ipcmsgbuf
{
long mtype;
char mtext[MAX_MSG_BUF_LEN];
};
int main( void )
{
int qid;
cha...
分类:
其他好文 时间:
2014-07-01 06:50:31
阅读次数:
199
Stage II过程分析
在Stage II中使用到了一些比较重要的数据结构,这里先对这些数据结构来进行下分析:
typedef struct global_data {
bd_t *bd;
unsigned long flags;
unsigned long baudrate;
unsigned long have_console; /* serial_init() was cal...
分类:
其他好文 时间:
2014-07-01 06:16:16
阅读次数:
371