码迷,mamicode.com
首页 >  
搜索关键字:typedef struct    ( 24378个结果)
二级指针删除链表元素
利用二级指针删除链表内一个元素,传统的做法是:找到将要删除元素的前一个指针,然后再删除当前元素。代码示例:void delete_node( elem_type x, struct node* l ){struct node* p = find_prev ( x, l );if ( !p->...
分类:其他好文   时间:2014-07-19 09:38:58    阅读次数:240
向量叉积判断两线段是否相交
判断两直线p1p2与q1q2是否相交,用向量叉积来判断如果P x Q >0,则P在Q的顺时针方向;如果P x Q #include #include #include #include typedef struct node{ double x,y;}point;point p1,p2,q1,...
分类:其他好文   时间:2014-07-19 09:38:36    阅读次数:279
Linux网络编程的一般步骤(1)
一、套接字的地址结构. IPV4套接字地址结构通常也称为"网际套接字地址结构",它以sockaddr_in 命名;POSIX定义如下:#include struct in_addr{ unsigned long s_addr; /*32-bit IPv4 address ...
分类:系统相关   时间:2014-07-19 09:34:33    阅读次数:408
Huffman树
结点定义:1 /*2 * Huffman树结点定义3 */4 struct Node5 {6 ElementType weight; // 结点的权值7 struct Node *leftChild; // 结点的左指针8 struct Node ...
分类:其他好文   时间:2014-07-19 09:19:34    阅读次数:225
广义表
结点类型定义: 1 /* 2 * 结点类型 3 */ 4 enum NodeType { head, atom, sublist }; 5 6 /* 7 * 定义广义表的结点结构(注意union的使用) 8 */ 9 struct Node10 {11 Boolean flag;...
分类:其他好文   时间:2014-07-19 09:16:35    阅读次数:257
线段树(自敲:建树,查找最大值,更新结点值)
HDU1754 1 #include 2 3 using namespace std; 4 5 const int MaxSIZE = 2e6 + 10; 6 7 typedef struct { 8 int Max ; 9 int left, right ...
分类:其他好文   时间:2014-07-19 09:14:48    阅读次数:250
CMSIS Example - osMailQ osMailPut osMailGet
1 struct Thread0_Mail 2 { 3 int a; 4 int b; 5 }; 6 7 osMailQId thread0_mail; 8 osMailQDef( thread0_mail, 10, struct Thread0_Mail ); 9 10 struct ...
分类:其他好文   时间:2014-07-19 09:03:28    阅读次数:1090
USACO Section 2.1 Ordered Fractions
/* ID: lucien23 PROG: frac1 LANG: C++ */ #include #include #include #include using namespace std; typedef struct Fraction { int numerator; int denominator; Fraction(){} Fraction(int x, int y...
分类:其他好文   时间:2014-07-19 02:31:25    阅读次数:199
C语言字节对齐问题详解
引言 考虑下面的结构体定义:1 typedef struct{2 char c1;3 short s; 4 char c2; 5 int i;6 }T_FOO; 假设这个结构体的成员在内存中是紧凑排列的,且c1的起始地址是0,则s的地址就是1,c2的地址...
分类:编程语言   时间:2014-07-19 00:37:47    阅读次数:409
typedef 和define的区别
总结一下typedef和#define的区别1.概念 #define 它在编译预处理时进行简单的替换,不作正确性检查。它是预处理指令。 typedef 它在自己的作用域内给一个已经存在的类型一个别名。它是在是在编译时处理的。 例子:#define:#define DO doubleDO val =....
分类:其他好文   时间:2014-07-19 00:33:30    阅读次数:275
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!