摘要: #ifdef __cplusplus#if __cplusplusextern "C"{#endif /* __cplusplus */#endif /* __cplusplus */这里面写的函数是C语言编译方式主要是函数命名方面#ifdef __cplusplus#if __cplusplus}#endif /* __cplusplus */#endif /* __cplusplus */=====================================简单的用在windows下可以如下定义:#ifdef __cplusplusextern "C&qu 阅读全文
posted @ 2013-09-05 22:48 cheshulin 阅读(148) 评论(0) 推荐(0) 编辑
摘要: /* *@author ? *@since 2011/07/29 *@function 实现链表的常用操作,比较粗糙。 * 功能大概是:显示链表结构;查询链表;删除节点;插入结点;修改结点 */#include #include struct node{ int value; struct node *next;};/* *插入结点(单个) */struct node *add_to_list(struct node *list,int n){ struct node *new_node; new_node=(node *)malloc(sizeof(... 阅读全文
posted @ 2013-09-05 22:48 cheshulin 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 有区别的,应该是sort函数的效率更高吧。qsort(数组名,数组长度,数组中每个元素大小,compare); compare函数的写法决定了排序是升序还是降序。需要#include例如:int compare(const void*a,const void*b){return *(*int)a-*(int*)b;} 示例:qsort(a,10,sizeof(int),compare) //假设已定义了整型数组a[10]升序排序的写法,如果是:return *(*int)b-*(int*)a 就是降序,不论是什么类型的数组,该函数的形式都是这样的sort(数组名,数组末地址,compare) 阅读全文
posted @ 2013-09-05 22:47 cheshulin 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\Folder\shell\cmdhere]@="命令行窗口"[HKEY_CLASSES_ROOT\Folder\shell\cmdhere\command]@="cmd /k cd %1" 阅读全文
posted @ 2013-09-05 22:47 cheshulin 阅读(198) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"#include "malloc.h"typedef struct tagstruct{ char a; long b; short c;}structm;int main(){ structm *pstruct=NULL; pstruct=(structm * )malloc(2*sizeof(structm)); if (NULL==pstruct) { return 1; } pstruct->a=0x11; pstruct->b=0x12345678; pstruct->... 阅读全文
posted @ 2013-09-05 22:46 cheshulin 阅读(155) 评论(0) 推荐(0) 编辑