摘要: classnum_sequence{public: num_sequence(void){}; virtualconstchar*what_am_i()const{return"num_sequence\n";}//注意这里的两个const virtual~num_sequence(void){};}; classFibonacci: publicnum_sequence{public: Fibonacci(void){}; constchar*what_am_i()const{return"Fibonacci\n";}//同样注意这里的两个const, 阅读全文
posted @ 2013-06-13 20:12 Predator 阅读(150) 评论(0) 推荐(0) 编辑
摘要: #include "IPerfomanceEstimate.h"#include <iostream>using namespace std;using namespace PerfomanceEstimateService;typedef struct tagPeople{public:string strName;//名字string strAddress;// 地址}PEOPLE;ostream & operator <<(ostream & os, const PEOPLE & people);void main(){ 阅读全文
posted @ 2013-06-13 19:39 Predator 阅读(210) 评论(0) 推荐(0) 编辑
摘要: #include "Function.h"#include <iostream>using namespace std;int Add(int a, int b);int MyCallBack(int (*pAdd)(int a, int b),int m, int n);void main(){int res = MyCallBack(Add,100,300);cout << res <<endl;int tem;cin >> tem;//system("pause");}#include "F 阅读全文
posted @ 2013-06-13 19:37 Predator 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #pragmaonce#ifndefAXXF_XXXX_ISUBJECT_H#defineAXXF_XXXX_ISUBJECT_H#include"IObserver.h"classIObserver;classISubject{public: ISubject(){} virtualchar*GetContent()const=0; virtualvoidAdd(IObserver*observer)=0; virtualvoidDelete(IObserver*observer)=0; virtualvoidTalk()=0; ~ISubject(){}}; #endi 阅读全文
posted @ 2013-06-13 19:35 Predator 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;void GetMaxValue(int *pDatas, int len);void main(){int datas1[6] = {1, -2, 3, 5, -3, 2};//输出子数组最大值为8//该子数组为:3 5;GetMaxValue(datas1, 6);//输出子数组最大值为:9 //该子数组为:3 5 -1 2int datas2[6] = {0, -2, 3, 5, -1, 2};GetMaxValue(datas2, 6);//输出子数组最大值为:-2//该子数组为: -2int d 阅读全文
posted @ 2013-06-13 00:51 Predator 阅读(449) 评论(0) 推荐(0) 编辑