摘要: #include <stdio.h>#include <malloc.h>#include <stdlib.h>#include "listtest.h" UINT32 CreatList(NodeList *L){ NodeList *p =NULL; NodeList *temp =L; if 阅读全文
posted @ 2017-02-19 14:44 cheshulin 阅读(267) 评论(0) 推荐(0) 编辑
摘要: #define ElemType int #define OK 0 #define ERROR 1 #define UINT32 unsigned int typedef struct Node { ElemType Value; struct Node *pNodeNext; }NodeList; /*************************************... 阅读全文
posted @ 2017-02-19 14:42 cheshulin 阅读(152) 评论(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) 编辑
摘要: #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) 编辑
摘要: 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) 编辑
摘要: 有区别的,应该是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) 编辑
摘要: #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) 编辑
摘要: #ifdef __cplusplus#if __cplusplusextern "C"{#endif /* __cplusplus */#endif /* __cplusplus */这里面写的函数是C语言编译方式主要是函数命名方面#ifdef __cplusplus#if __cplusplus}#endif /* __cplusplus */#endif /* __cplusplus */ 阅读全文
posted @ 2013-08-31 08:21 cheshulin 阅读(127) 评论(0) 推荐(0) 编辑
摘要: NODE *list;//list->value, list->next;NODE *A = list;NODE *B;if(A==pHead){ if(A->value>B->value) { A->next=B->next; B->next=A; A=B;//好像错误A0->next=B A0=B; B=A->next; } A0=A; A=B; B=A->next;}else{ NODE *A0 = Head; for(A=Head;A->next != NULL;A=A->next) { for(B= A-& 阅读全文
posted @ 2013-08-24 08:34 cheshulin 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 //class String 4 //{ 5 //public: 6 // String(const char *str = NULL); 7 // 普通构造函数 // String(const String &other); 8 // 拷贝构造函数 9 // ~ String(void); // 析构函数 10 // String & operate =(const String &other); // 赋值函数 11 //private: 12 // char *m_data; 13 // 用于 阅读全文
posted @ 2013-08-20 23:10 cheshulin 阅读(215) 评论(0) 推荐(0) 编辑