码迷,mamicode.com
首页 >  
搜索关键字:typedef struct    ( 24378个结果)
(转)单链表的逆置
对于单链表的逆置有两种方法可以实现:(1)利用辅助指针 基本思想:在遍历结点过程中,设置辅助指针,用于记录先前遍历的结点。这样依次编译的过程中只需修改其后继结点的next域即可。 实现代码: 1 typedef int DataType; //类型定义 2 typedef struct ...
分类:其他好文   时间:2014-07-07 10:48:40    阅读次数:210
block,__bridge_retained代码试例
typedef void (^dd)(void);@property (strong) dd a ;@property (copy) dd a ;__weak id b=self; self.a=^{ NSLog(@"%@",self); };编译器都会有警告:循环引用造成的内存泄露---...
分类:其他好文   时间:2014-07-07 09:17:36    阅读次数:221
struct与union字节大小的终极解释
1、字节对齐的细节和编译器实现相关,但一般而言,如在windows下,就VC而言,满足一下三个准则:1) 结构体变量的首地址能够被其最宽基本类型成员的大小所整除;2) 结构体每个成员相对于结构体首地址的偏移量(offset)都是成员大小的整数倍,如有需要编译器会在成员之间加上填充字节(interna...
分类:其他好文   时间:2014-07-03 22:26:38    阅读次数:246
触摸屏驱动程序
触摸屏驱动程序框架与上一片文章的输入子系统类似,只是底层驱动由按键变成了触摸屏。S3C2440的ADC相关寄存器:struct s3c_ts_regs { unsigned long adccon; unsigned long adctsc; unsigned long adcdly; un...
分类:其他好文   时间:2014-07-02 21:54:57    阅读次数:285
【转】Linux 定时器setitimer()
http://blog.sina.com.cn/s/blog_590be5290100izdf.html用法:#include int getitimer(int which, struct itimerval *value);int setitimer(int which, const struc...
分类:系统相关   时间:2014-07-02 17:56:16    阅读次数:260
POJ 1135 Domino Effect
最短路问题,我用的SPFA。 求出各个点的最短时间。 然后每条边的为 (d[u]+d[v]+len)/2   len 为此边长度。 然后找时间最长的。 #include #include #include #include #include using namespace std; int n,m; struct lx { int v; double t; }; v...
分类:其他好文   时间:2014-07-02 11:34:13    阅读次数:136
Leetcode:Sort List 对单链表归并排序
Sort a linked list in O(n log n) time using constant space complexity. 看到O(n log n)的排序算法,适合单链表的首先想到的就是归并排序 /** * Definition for singly-linked list. * struct ListNode { * int val; * Lis...
分类:其他好文   时间:2014-07-02 08:47:34    阅读次数:239
Swift构造器(Initializer)与析构器(Deinitializer)
为了初始化结构体和类等类型的实例属性。默认构造器  struct Fahrenheit {var temperature: Doubleinit(){temperature = 32.0} } var f = Fahrenheit() //调用默认构造器 init() ,没有参数 没有返回值。println("The default temperature   is \(f.temperature...
分类:其他好文   时间:2014-07-02 08:42:57    阅读次数:304
hdu 1071 The area 高斯消元求二次函数+辛普森积分
构造系数矩阵,高斯消元求解二次函数,然后两点式求直线函数,带入辛普森积分法无脑AC。。。 #include #include #include #include #include #include using namespace std; struct node { double x,y; }p[4]; double g[10][10]; double f1(double x) //二次...
分类:其他好文   时间:2014-07-02 07:56:59    阅读次数:313
Leetcode:Merge Two Sorted Lists 合并两个有序单链表
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 代码如下: * Definition for singly-linked list. * struct L...
分类:其他好文   时间:2014-07-02 07:23:59    阅读次数:159
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!