摘要:
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, 阅读全文
摘要:
#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(){ 阅读全文
摘要:
#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 阅读全文
摘要:
#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 阅读全文
摘要:
#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 阅读全文