码迷,mamicode.com
首页 >  
搜索关键字:struct ethhdr    ( 18974个结果
串(C++实现)
本段程序实现串的存储结构是采用堆的动态分配存储表示,并实现了几乎所有常用的串的配套函数 其中逻辑性比较强的就是串的模式匹配算法,在下面的程序中,分别用BF算法和KMP算法对其进行了 实现。 #include using namespace std; struct HString { HString() { ch = 0; length = 0; } char * ch;//...
分类:编程语言   时间:2014-05-14 01:12:35    阅读次数:378
用select单个进程处理并发服务器
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); void FD_CLR(int fd, fd_set *set); int  FD_ISSET(int fd, fd_set *set); void FD_SET(int fd, fd...
分类:其他好文   时间:2014-05-14 00:03:02    阅读次数:440
__attribute__((packed))的作用
__attribute__((packed))的作用   在结构体变量的声明中,经常可以看到__attribute__((packed))修饰符。这是做什么用的呢?请看一下程序: #define u8 unsigned char #define u16 unsigned short #define u32 unsigned int int main() { struct { ...
分类:其他好文   时间:2014-05-13 06:19:18    阅读次数:416
利用数据结构栈求解迷宫问题
本段程序主要利用数据结构栈的先进后出特点,实现回溯求解迷宫路径问题。 #include #include using namespace std; //坐标类 struct Point { int x; int y; }; //地图类 template struct Map { int (*p)[A]; int row;//行数 int col;//列数 }; //start起始点, ...
分类:其他好文   时间:2014-05-13 05:25:02    阅读次数:478
boost::archive::binary_iarchive
#include #include #include #include #include #include #include #include #include #include using namespace std;struct MyStruct{ string stru; int ...
分类:其他好文   时间:2014-05-12 21:51:09    阅读次数:572
C语言学习--类的模拟
在学习linux下编程时,不可避免的要学C了,下面先简单写写C下对C++中的类的模拟。我们要用到的是 struct和函数指针,不懂的同学自行搜索这两个东东,我现在只写我的第一个实现,更多实现方式我会稍后补充。首先先上代码: 1 #include 2 #include 3 4 struct Swen....
分类:编程语言   时间:2014-05-12 02:45:26    阅读次数:279
GeeksforGeeks - Adjacency List邻接矩阵C代码
邻接矩阵的图示: 构建一个这样的无向邻接矩阵。 参考网站: http://www.geeksforgeeks.org/graph-and-its-representations/ 这里写了个类,增加删除图的操作。 #pragma once #include #include class AdjListGraph { struct Node { int dest; ...
分类:其他好文   时间:2014-05-11 22:44:20    阅读次数:378
图的深度优先遍历--邻接表实现
这里用邻接表实现图的深度优先遍历,采用递归实现。 #include using namespace std; #define VERTEXNUM 5//结点数 struct edgenode { int to; int weight; // 边的权值 edgenode *next; }; struct vnode { int from...
分类:其他好文   时间:2014-05-11 20:46:16    阅读次数:519
【error LNK2005: "struct HWND__ * ui_hwnd" (?ui_hwnd@@3PAUHWND__@@A) 已经在 Susake.obj 中定义】
产生原因:多文件包含时,全局变量未用extern解决方法:直接在全局变量前加上extern即可,若要在在其他文件中使用,该变量声明下就ok了~~另外引出一个话题,你是不是也发现了这么一个现象??比如A.hA.cpp#include "A.h"#include "B.h"HWND ui_hwnd, h...
分类:其他好文   时间:2014-05-11 17:25:39    阅读次数:526
数据结构与算法-链表的基本操作---ShinPans
//链表操作:建立、插入、删除、查找、倒置、删除等基本操作 #include #include typedef  struct LNode {       int data;       structLNode *next; }LNode,*Llist; LNode *creat_head();//创建一个空表 void creat_list(LNode *,int);//创...
分类:其他好文   时间:2014-05-11 03:33:11    阅读次数:351
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!