摘要: #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...
阅读全文
摘要: 将要编译的代码如下, 名字是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...
阅读全文
摘要: 当年,周恩来总理有一只钢纸箱(钢纸是经特殊工艺处理的特种纸,多用做绝缘材料和隔热材料等),那是他在1954年出席日内瓦会议时购买的。 从那以后,周恩来每次出国访问,都要随身带上这只钢纸箱,因为在这只钢纸箱里,一直隐藏着周恩来的一个重要秘密…… 1963年12月14日,周恩来出访埃及,下榻在开罗国宾馆。晚上9点多钟,一辆黑色轿车从宾馆驶了出来。聚集在门外的外国记者见是周恩...
阅读全文
摘要: #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; +...
阅读全文
摘要: 算法中使用到了堆,即stl中的multiset。#include <iostream>#include <vector>#include <set>using namespace std;typedef multiset<int, greater<int>> IntHeap;void FindKLeastNumbers(const vec...
阅读全文
摘要: #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...
阅读全文
摘要: #include <iostream>using namespace std;bool FindGreatestSumOfSubArray(int *pData, unsigned int nLength, int &nGreatestSum){if (!pData||0==nLength){return false;}int nCurrentSum=nGreatestSum=...
阅读全文
摘要: #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...
阅读全文
摘要: #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*...
阅读全文
摘要: 采用两个双端队列实现,一个存数据,一个是辅助栈,存第一个栈的最小元素的地址,实现技巧在于辅助栈存放的是第一个栈的最小元素的地址,难度在于使用模板实现。#include <deque>#include <assert.h>#include <iostream>using namespace std;template <typename T>class ...
阅读全文
摘要: #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...
阅读全文
摘要: DLL中导出函数的声明有两种方式:一种方式是:在函数声明中加上__declspec(dllexport);另外一种方式是:采用模块定义(.def)文件声明,(.def)文件为链接器提供了有关被链接程序的导出、属性及其他方面的信息。方式一:在函数声明中加上__declspec(dllexport)/// 在动态链接库程序中/// 声明动态链接库(**.dll)的对外接口函数TestFuctionex...
阅读全文
摘要: 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...
阅读全文
摘要: #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...
阅读全文
摘要: #include <iostream>#include <limits>#include <stdlib.h>using namespace std;typedef unsigned __int64 UINT64; typedef __int64 INT64; int main(){int intMax = numeric_limits<int>::...
阅读全文
摘要: 原文件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 &...
阅读全文
摘要: 将要编译的代码如下, 名字是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...
阅读全文
摘要: 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为返回值...
阅读全文