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