发布时间:2012-12-31 16:59:07
// operatorReload.cpp : 定义控制台应用程序的入口点。// #include "stdafx.h" class CPoint {public: CPoint(int x1,int y1); CPoint operator+(CPoint pt); CPoint operator-(CPoint pt); void operator=(CPoint pt); void PrintPt(); private: int x; int y;}; CPoint::CPoint(int x1,int y1)......【阅读全文】
发布时间:2012-12-31 15:41:18
#include "stdafx.h"#include <iostream>using namespace std; class cat{public: cat(); cat(cat*); void setInfo(int age,int color,int weight); void printInfo();private: int age; int weight; int color;}; cat::cat(){} cat::cat(cat* a_cat){ this->age = a_......【阅读全文】
发布时间:2012-12-31 11:11:45
#include "stdafx.h"#include <iostream>using namespace std; class animal{public: virtual void eat() = 0;}; class bird : public animal{public: virtual void eat();}; class beast: public animal{public: virtual void eat();}; class cock:public bird{public: virtual void eat();......【阅读全文】
发布时间:2012-12-28 14:07:19
#include "stdafx.h"#include <iostream> class cat{public: friend void setCatHigh(cat* wendy,int value); friend void setCatWeight(cat* wendy,int value); friend void setCatColor(cat* wendy,int value); public: void getCatInfo(int &high,int &weight,int &color);priv......【阅读全文】