12 2013 档案

摘要:#include #include int main(int argc, char **argv) { QApplication app(argc,argv); QPushButton * button =new QPushButton; button->setText("hello Qt"); but... 阅读全文
posted @ 2013-12-25 12:16 Android开发8585 阅读(182) 评论(0) 推荐(0) 编辑
摘要:/*本程序实现分块查找算法 又称索引顺序查找 需要注意的是分块查找需要2次查找 先对块查找 再对块内查找 2013.12.16 18:44*/ #include #include #include #define N 12 struct index { int key; int start; ... 阅读全文
posted @ 2013-12-23 18:41 Android开发8585 阅读(199) 评论(0) 推荐(0) 编辑
摘要:私有成员:友元类或友元函数,类内成员 保护成员:派生类+(同上) 公有成员:对象名.成员,静态成员 类名::成员,+(同上) 构造函数的访问方法: 1.对象名.构造函数 2.友元函数调用 阅读全文
posted @ 2013-12-19 20:37 Android开发8585 阅读(216) 评论(0) 推荐(0) 编辑
摘要:#include using namespace std; class A { public: friend void test(A a); int a1; A() { cout<<"A"<<"\n"; } }; void test(A a) { ... 阅读全文
posted @ 2013-12-19 20:21 Android开发8585 阅读(342) 评论(0) 推荐(0) 编辑
摘要:/* 应用调用采用地址传递 */ #include using namespace std; void swap(int &a,int &b) { int t; t=a; a=b; b=t; } int main() { int x=8,y=5; cout<<x<<"... 阅读全文
posted @ 2013-12-18 15:12 Android开发8585 阅读(170) 评论(0) 推荐(0) 编辑
摘要:/*本程序实现分块查找算法 又称索引顺序查找 需要注意的是分块查找需要2次查找 先对块查找 再对块内查找 2013.12.16 18:44*/ #include #define N 12 struct index { int key; int start; int end; }index[4]; ... 阅读全文
posted @ 2013-12-18 15:08 Android开发8585 阅读(308) 评论(0) 推荐(0) 编辑
摘要:/*本程序采用折半查找算法查找数据的位置 2013.12.06.18:11 */ #include int search(int a[],int l,int o)//实现折半查找 { int mid; int high=l-1;//notice int low=0; do { mi... 阅读全文
posted @ 2013-12-18 15:07 Android开发8585 阅读(210) 评论(0) 推荐(0) 编辑
摘要:/* 采用顺序查找方法,查找指定数据 2013.12.16 18.05*/ #include int search(int a[],int l,int o)//查找函数 { int i; for(i=0;i=0) printf("您查找的数据 %d在 %d处\n",input,result); goto m... 阅读全文
posted @ 2013-12-18 15:03 Android开发8585 阅读(129) 评论(0) 推荐(0) 编辑
摘要:#include using namespace std; class A { public: A() { cout<<"constructing A"<<endl; } ~A() { cout<<"desconstruting A"<<endl; } }; void disp() { A oo; } int main() { //A oo; disp(); cout<<"take a mark"<<endl; }当对象生存周期结束时,析... 阅读全文
posted @ 2013-12-18 14:33 Android开发8585 阅读(445) 评论(0) 推荐(0) 编辑
摘要:/* 1.只能重载c++提供的标准运算符 2.参数个数固定 3.针对类的对象操作运算符的重载形势只有两种: 一种是重载为类的友元行数特殊运算符的重载“--” “++” 等等http://c.chinaitlab.com/special/czhenyan/Index.html*/#include using namespace std; class base { public: int a1; float b1; base() { a1=0; b1=0.0; cout<<"constructing base "<<en... 阅读全文
posted @ 2013-12-18 12:31 Android开发8585 阅读(309) 评论(0) 推荐(0) 编辑
摘要:#include using namespace std;class base{protected: int x;public: base(int x1) { x=x1; cout<<"constructing base,x="<<x<<endl; } ~base() { cout<<"disconstructing base"<<endl; }};class ba... 阅读全文
posted @ 2013-12-14 22:40 Android开发8585 阅读(647) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示