摘要: #include "iostream"using namespace std;struct node { int key; node* left; node* right; node(){} node(int x):key(x),left(NULL),right(NULL){}};struct Tree { node* root; Tree():root(NULL){}};void push(node* S,node x){ S[0].key++; S[S[0].key]=x;}node* pop(node* S){ if (S[0]... 阅读全文
posted @ 2013-05-10 16:26 LS2012 阅读(133) 评论(0) 推荐(0)
摘要: #include<iostream>using namespace std;class Cbase;Cbase *pc = NULL;class Cbase{public: Cbase() { //将指向基类的this指针赋给全局Cbase类指针 pc = this; }public: virtual void fun(){ cout<<"class Cbase"<<endl;}};class Cchild : public Cbase{public: virtual void fun() { cout << "cl 阅读全文
posted @ 2012-12-01 10:40 LS2012 阅读(138) 评论(0) 推荐(0)