- 博客(6)
- 收藏
- 关注
转载 【转】memcpy memmove 区别
memcpy 和memmove 都是把一个内存块拷贝到另一个内存块,其区别为:memcpy 不考虑源内存块和 目标内存块 是否重叠的情况,即 source | | dest | |而memmove则考虑了这一情况,当遇到这种情况的时候,拷贝是从最高位开始,这样就保证source中还没拷贝的块不会因为dest的原因被修改。
2010-06-23 13:48:00 573
转载 [转]二叉树三种遍历的非递归算法转
1.先序遍历非递归算法#define maxsize 100typedef struct{ Bitree Elem[maxsize]; int top;}SqStack;void PreOrderUnrec(Bitree t){ SqStack s; StackInit(s); p=t; while (p!=null || !StackEmpty(s)) { while (p!=null)
2010-06-21 22:45:00 531
转载 【转】判断大端小端模式
试题1:请写一个C函数,若处理器是Big_endian的,则返回0;若是Little_endian的,则返回1解答:int checkCPU( ){ { union w { int a; char
2010-06-21 22:31:00 569
转载 [转]用单向循环链表解决约瑟夫环问题
设有n个人围坐一圈,现以某个人开始报数,数到m的人出列,接着从出列的下一个人开始重新报数,数到m的人又出列,如此下去,直到所有人都出列为止.按出列顺序输出. 这段代码是从网上找来的,在此特别说明!!!!!C代码 #include "stdlib.h" struct ele { int no; struct ele *link; } main() { struct ele *h, *u, *p; int n, m, i; printf("Ple
2010-06-21 22:16:00 1723
转载 【转】linux2.6驱动-设备结构
linux2.6驱动-设备结构<br /> <br />从2.6版本开始引入了platform这个概念,在开发底层驱动程序时,首先要确认的就是设备的资源信息,例如设备的地址,<br />在2.6内核中将每个设备的资源用结构platform_device来描述,该结构体定义在kernel/include/linux/platform_device.h中,<br />struct platform_device {<br />const char * name;<br />u32 id;<br />stru
2010-06-18 11:24:00 547
转载 【转】Linux内核的container_of宏
Linux内核的container_of宏作用:通过一个结构的成员的地址和结构名以及成员名,获得结构的首地址。宏定义:include/linux/kernel.hC代码 /** * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the member. * @type: the type of the container struct t
2010-06-04 14:14:00 588
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人