上一页 1 ··· 5 6 7 8 9
摘要: 1.extern“C”在函数前面加上后,编译器将函数当成c代码对待,主要用在c++调用c代码的时候,c++有重载在编译时会加上参数类型,而c不支持重载。2.文件A中定义全局函数fun(),要在文件B中调用,需在B中加上extern声明。3.函数、变量的声明放在头文件,不要在头文件中定义。4.如果要在... 阅读全文
posted @ 2016-01-11 11:19 mximo 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 方法有很多,这里只举一种,先定义栈结点的数据结构typedef struct{Node * p; int rvisited;}SNode //Node 是二叉树的结点结构,rvisited==1代表p所指向的结点的右结点已被访问过。lastOrderTraverse(BiTree bt){ //首... 阅读全文
posted @ 2016-01-02 21:10 mximo 阅读(275) 评论(0) 推荐(0) 编辑
摘要: #include#include using namespace std;typedef char (*PTRFUN)(int);PTRFUN pFun;char glFun(int a){ cout<<11111<<endl;}int main(){ pFun = glFun; (*p... 阅读全文
posted @ 2015-11-06 08:40 mximo 阅读(131) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;templateclass CTopK{public: CTopK(); ~CTopK(); T* m_Data; int GetTopK(const char* sFile, int& nTop);private:... 阅读全文
posted @ 2015-11-04 17:04 mximo 阅读(170) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;void CreatHeap(int a[],int n,int h){ int i,j,flag; int temp; i = h; j = 2*i + 1; temp = a[i]; flag = 0;... 阅读全文
posted @ 2015-11-04 11:19 mximo 阅读(240) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9