前进的道路不是一帆风顺的,要随时迎接挑战,敢于战胜困难!

坚持一下,找人聊聊天,释放一些压力!

 

[置顶] C语言实现回调函数的源码

摘要: #include <stdio.h>#include <stdlib.h>#include <string.h>typedef char byte;typedef int (__stdcall *CompareFunction)(const byte*, const byte*);void __stdcall Bubblesort(byte* array,int... 阅读全文

posted @ 2009-06-15 16:41 山径山精 阅读(1196) 评论(0) 推荐(0) 编辑

[置顶] linux使用pkg-config写简单的Makefile

摘要: 将要编译的代码如下, 名字是add_node.c#include <stdio.h> #include <string.h> #include <stdlib.h> #include <libxml/xmlmemory.h> #include <libxml/parser.h> #include "null.h"void parseSto... 阅读全文

posted @ 2009-05-18 10:10 山径山精 阅读(1943) 评论(0) 推荐(0) 编辑

[置顶] 揭秘:藏在*总理钢纸箱中的秘密!

摘要: 当年,***总理有一只钢纸箱(钢纸是经特殊工艺处理的特种纸,多用做绝缘材料和隔热材料等),那是他在1954年出席日内瓦会议时购买的。 从那以后,***每次出国访问,都要随身带上这只钢纸箱,因为在这只钢纸箱里,一直隐藏着***的一个重要秘密…… 1963年12月14日,***出访埃及,下榻在开罗国宾馆。晚上9点多钟,一辆黑色轿车从宾馆驶了出*。聚集在门外的外国记者见是**... 阅读全文

posted @ 2008-11-20 12:10 山径山精 阅读(513) 评论(6) 推荐(0) 编辑

[置顶] VC6.0遥控器模拟键盘(含组合键)消息控制另一个程序

该文被密码保护。 阅读全文

posted @ 2008-11-19 11:21 山径山精 阅读(58) 评论(0) 推荐(0) 编辑

2010年8月11日

判断整数序列是不是二元查找树的后序遍历结果

摘要: #include <iostream>using namespace std;bool verifySquenceOfBST(int squence[], int length){if (squence==NULL||length<=0){return false;}int root=squence[length-1];int i=0;for(; i<length-1; +... 阅读全文

posted @ 2010-08-11 16:29 山径山精 阅读(248) 评论(0) 推荐(0) 编辑

查找最小的k个元素

摘要: 算法中使用到了堆,即stl中的multiset。#include <iostream>#include <vector>#include <set>using namespace std;typedef multiset<int, greater<int>> IntHeap;void FindKLeastNumbers(const vec... 阅读全文

posted @ 2010-08-11 15:25 山径山精 阅读(370) 评论(0) 推荐(0) 编辑

在二元树中查找和为某一值的所有路径

摘要: #include <iostream>#include <vector>using namespace std;struct BinaryTreeNode{int m_nValue;BinaryTreeNode* m_pLeft;BinaryTreeNode* m_pRight;};int count=0; //print controlvoid FindPath(Bina... 阅读全文

posted @ 2010-08-11 14:25 山径山精 阅读(254) 评论(0) 推荐(0) 编辑

求子数组的最大和

摘要: #include <iostream>using namespace std;bool FindGreatestSumOfSubArray(int *pData, unsigned int nLength, int &nGreatestSum){if (!pData||0==nLength){return false;}int nCurrentSum=nGreatestSum=... 阅读全文

posted @ 2010-08-11 13:34 山径山精 阅读(271) 评论(0) 推荐(0) 编辑

把二元查找树转变成排序的双向链表

摘要: #include <iostream>#include <time.h>#define MAX_NUM 10using namespace std;struct BSTreeNode {int m_nValue;BSTreeNode *m_pLeft;BSTreeNode *m_pRight;};int count=0;void AddTree(BSTreeNode** T... 阅读全文

posted @ 2010-08-11 12:59 山径山精 阅读(513) 评论(0) 推荐(0) 编辑

2010年8月10日

编写String类的构造函数,析构函数,赋值函数

摘要: #include <iostream>using namespace std;class String{public:String(const char* str=NULL);String(const String& other);~String(void);String & operator =(const String& other);const char*... 阅读全文

posted @ 2010-08-10 17:40 山径山精 阅读(475) 评论(0) 推荐(0) 编辑

设计包含min函数的栈(源码)

摘要: 采用两个双端队列实现,一个存数据,一个是辅助栈,存第一个栈的最小元素的地址,实现技巧在于辅助栈存放的是第一个栈的最小元素的地址,难度在于使用模板实现。#include <deque>#include <assert.h>#include <iostream>using namespace std;template <typename T>class ... 阅读全文

posted @ 2010-08-10 13:53 山径山精 阅读(1115) 评论(0) 推荐(0) 编辑

2010年8月9日

自己写的大整数乘法C++程序,请指正。

摘要: #include <iostream>using namespace std;int multi(const int a[], const int b[], int c[], const int len){for (int k=0; k<2*len-1; k++){for (int i=0; (i<k+1)&&(i<len); i++){if (k-i... 阅读全文

posted @ 2010-08-09 18:02 山径山精 阅读(540) 评论(0) 推荐(0) 编辑

2010年8月4日

DLL中导出函数的两种方式(dllexport与.def文件)

摘要: DLL中导出函数的声明有两种方式:一种方式是:在函数声明中加上__declspec(dllexport);另外一种方式是:采用模块定义(.def)文件声明,(.def)文件为链接器提供了有关被链接程序的导出、属性及其他方面的信息。方式一:在函数声明中加上__declspec(dllexport)/// 在动态链接库程序中/// 声明动态链接库(**.dll)的对外接口函数TestFuctionex... 阅读全文

posted @ 2010-08-04 13:31 山径山精 阅读(16922) 评论(0) 推荐(0) 编辑

2010年7月26日

Adding vertical guides to the Visual Studio text editor

摘要: Adding vertical guides to the Visual Studio text editorSomething that I’ve done and liked since VS2005, has been to add vertical guides to the VS text editor. For example: I like putting them at... 阅读全文

posted @ 2010-07-26 11:43 山径山精 阅读(328) 评论(0) 推荐(0) 编辑

2009年6月9日

C常用类型的范围--源代码

摘要: #include <iostream>#include <limits>#include <stdlib.h>using namespace std;typedef unsigned __int64 UINT64; typedef __int64 INT64; int main(){int intMax = numeric_limits<int>::... 阅读全文

posted @ 2009-06-09 14:30 山径山精 阅读(476) 评论(0) 推荐(1) 编辑

2009年5月21日

Linux g++关于warning: extra tokens at end of #endif directive

摘要: 原文件TimeSynManager.h#ifndef TimeSynManager_h__#define TimeSynManager_h__const int max_year=1100;const int min_year=70;typedef long long __int64;#include <time.h>#include <stdio.h>#include &... 阅读全文

posted @ 2009-05-21 10:01 山径山精 阅读(5233) 评论(0) 推荐(0) 编辑

2009年5月14日

函数指针类型和回调函数

摘要: typedef void (*pf)(void*);void use_cb(pf cb,void*date){(*cb)(data);}void f1(void* data){printf("%s",(char*)data);}void main(void){use_cb(f1,void*)"hello world!\n");}程序中有很多笔误不一一指出。pf是定义void*为参数void为返回值... 阅读全文

posted @ 2009-05-14 09:35 山径山精 阅读(479) 评论(0) 推荐(0) 编辑

导航