码迷,mamicode.com
首页 >  
搜索关键字:struct enum    ( 22969个结果
poj 2718 最优比例生成树(01分数规划)模板
/* 迭代法 :204Ms */ #include #include #include #define N 1100 #define eps 1e-10 #define inf 0x3fffffff struct node { int u,v,w; }p[N]; double ma[N][N]; double distance(int i,int j) { return sqrt(1.0*(...
分类:其他好文   时间:2014-08-19 11:01:44    阅读次数:338
【ThinkingInC++】27、全局作用域解析
/** * 功能:全局作用域解析 * 时间:2014年8月19日10:51:32 * 作者:cutter_point */ int a; //全局 void f(){} //全局 struct S { int a; void f(); }; void S::f() { ::f(); //外面那个。全局的 ::a++; //外面那个全局...
分类:编程语言   时间:2014-08-19 10:56:04    阅读次数:215
Direct2D --- The First Step
遇到的困难:1,error LNK2019: 无法解析的外部符号 _D2D1CreateFactory@16,该符号在函数 "long __cdecl D2D1CreateFactory(enum D2D1_FACTORY_TYPE,struct _GUID const &,void * *)" (...
分类:其他好文   时间:2014-08-19 10:40:03    阅读次数:250
typedef和#define的区别——————【Badboy】
typedef 和#define 都常用来定义一个标识符及关键字的别名,但他们之间有关键的区别。   typedef 是语言编译过程的一部分;   #define是宏定义语句,它本身并不在编译过程中进行,而是在这之前的预处理过程就已经完成了。   要理解两者的关键区别,可以这么来考虑 :   把typedef 看成是一种彻底的"封装"类型,相当于产生了一个新的变量类型(这点与struct ...
分类:数据库   时间:2014-08-19 09:24:33    阅读次数:251
statfs函数说明
函数: statfs功能描述: 查询文件系统相关的信息。用法: #include /* 或者 */ int statfs(const char *path, struct statfs *buf); int fstatfs(int fd, struct statfs *buf);参...
分类:其他好文   时间:2014-08-19 09:18:43    阅读次数:947
实现一个算法从一个单链表中返回倒数第n个元素(keep it up)
我们维护两个指针, 它们之间的距离为n。然后,我将这两个指针同步地在这个单链表上移动,保持它们的距离 为n不变。那么, 当第二个指针指到空时,第一个指针即为所求。 #include struct Node { int data; Node* next; }; void initList(Node* vNode) { for (int i=0; i < 20; ++i) {...
分类:其他好文   时间:2014-08-19 01:00:33    阅读次数:257
c++模板的一些语法
模板的部分特化 template struct testClass { testClass(){cout<<"I,O"<<endl;} }; template struct testClass { testClass(){cout<<"T*,T*"<<endl;} }; 成员模板 template class v { public: template void in...
分类:编程语言   时间:2014-08-18 23:35:23    阅读次数:269
算法题——翻转链表中的一段
题目:给出一个链表中的两个指针p1和p2,将其之间的结点翻转。思路:可以通过交换结点内的值来实现结点的翻转,空间为O(N);如果要求不能交换值,那么仅凭p1和p2是无法翻转的,只能交换两个指针之间的链表。代码:交换值: 1 struct ListNode 2 { 3 int val; 4 ...
分类:其他好文   时间:2014-08-18 23:31:53    阅读次数:257
常量类型
三种定义常量的方法 1 #include 2 3 //1. 预编译 4 #define PI 3.14 5 6 int main(void) 7 { 8 //2. const关键字 9 const int LENGTH = 100;10 11 //3. 枚举类型12 enum ...
分类:其他好文   时间:2014-08-18 23:20:43    阅读次数:248
对 dpif_class 结构体的一点认识
类 dpif_class 抽象的是OVS交换机用户空间和内核层datapath的通信接口(通过netlink),分层是出于性能和生产效率的考虑,通过接口dpif_class,用户层ovs-vswitchd会把发送各种端口,流表,查询等动作到内核层进行实际的执行,比如说我们增加一个端口到ovs中,那么就会从用户空间构造增加端口的 dpif_linux_vport 请求到datapath层。重点要...
分类:其他好文   时间:2014-08-18 22:09:53    阅读次数:279
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!