ChinaUnix.net
相关文章推荐:

链表的各种操作

#define list_entry(ptr, type, member) \ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) 谁解释一下这个语句的含义?

by eagles125 - C/C++ - 2007-02-10 17:04:52 阅读(909) 回复(2)

相关讨论

带头指针的链表实现在第n个节点前插入一个新节点node,为何插入不能正常工作,高手帮看看! #include #include #define N 5 typedef struct node { char name[20]; struct node *link; }stud; stud * creat(int n) { stud *p,*h,*s; int i; if((h=(stud *)malloc(sizeof(stud)))==NULL) { printf("不能分配内存空间!"); exit(0); } h->name[0]='\0'; h->link=NULL; p...

by howema - C/C++ - 2009-03-15 18:02:26 阅读(1040) 回复(6)

#include #include typedef struct LNode{ int data; struct LNode *next; }LNode,*LinkList; void initlist(LinkList L); int Inselem(LinkList L,int i,int x); void displist(LinkList L); int Getlen(LinkList L); main() { LinkList List=NULL; int ii,xx,error,counter; initlist(List); printf("Please enter the linklist size:"); scanf("%d",&List->data); printf("\...

by ktzlj - C/C++ - 2006-11-30 17:07:16 阅读(907) 回复(0)

最近对mysql的复制用得比较多,防止忘掉,在此记下各种操作。 You do not need the line master-port= of the slave, if you not changed the port. Normal : 3306 To add a user for the master server you need this line mysql> GRANT FILE ON *.* TO repl@"%" IDENTIFIED BY ''; You have to change "%" to the IP Adress from the SLAVE. Example: mysql> GRANT FILE ON *.* TO repl@192.168.0.2 IDENTIFIED BY 'you...

by hnynes - MySQL文档中心 - 2009-08-13 22:39:13 阅读(1189) 回复(0)

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12976/showart_85770.html

by mtin - SCO文档中心 - 2006-03-15 17:31:43 阅读(773) 回复(0)

请看一下是哪的问题 struct time_save { char str_time[20]; int str_fresh; struct time_save *next; }; 我想定写一个函数 struct time_save addstu(struct time_save *thread,char *time,int fresh_site) 其中thread为给定一个结构体,char *time,int fresh_site,为一个结构的两项要插入到thread,并返回thread结构体 请各位帮一下

by stiandao - C/C++ - 2005-12-03 14:50:51 阅读(867) 回复(5)

之前在本版发 了帖子问这个链表操作导致内存泄露的问题,可能是我描述不够细致,以至无人回答我的问题。 经过两天的调试,我发现其实这并不能算是内存泄露,只是内存的暂时减少。 但是,我在做链表操作的时候是限制了链表长度为12的,而测试中也反复检查过,长度绝对没有超过12 问题的表现为:12个同样的节点,占用的内存数应该是一样大小的,也就是说我在测试中无论插入多少个节点,最后总数就只有12个, 那么在插入操作完成后,系...

by sithui - C/C++ - 2008-12-10 17:37:35 阅读(847) 回复(0)

以前写的一个链表操作,最近调试发现有内存泄露问题,可是仔细检查没发现不对的地方。 这个文件的作用就是保存12调图片信息,新增的图片插入到链表头,多余12张时从链表尾部做删除,再插入。 在外部调用FnPhotoMsg_Add时发现会有泄露。这个函数接收的pbuf参数由调用者分配和管理的。 FileApi_SendFileOptQueue是一个异步的文件存储、删除操作,用队列进行缓冲,这个文件操作已经经过验证了,不会发生泄露。 FnPhotoMsg_BgCfgSet只在...

by sithui - C/C++ - 2008-12-09 12:05:53 阅读(1539) 回复(5)
by prc - C/C++ - 2006-04-11 09:47:31 阅读(1875) 回复(9)

java中提供了io类库,可以轻松的用java实现对文件的各种操作。下面就来说一下如何用java来实现这些操作。 新建目录 新建文件 删除文件 文件拷贝 "+byteread+""); bytesum+=byteread; out.println(bytesum); fs.write(buffer,0,byteread); } inStream.close(); %> 整个文件夹拷贝 if(file.isFile()){ file.toString(); FileInputStream input=new FileInputStream(file); FileOutputStream output=new...

by 孤独键盘 - Java文档中心 - 2007-06-26 00:11:32 阅读(425) 回复(0)

java中提供了io类库,可以轻松的用java实现对文件的各种操作。下面就来说一下如何用java来实现这些操作。 全文阅读:http://www.javah.net/JAVAmoshi/20070516/1392.html 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/35816/showart_304472.html

by zaowei21 - Java文档中心 - 2007-05-19 01:45:59 阅读(411) 回复(0)