#include <iostream>
using namespace std;
class Rectangle
{
public:
Rectangle();
~Rectangle();
void setlength(int length){itslength=length;}
int getlength()const{return itslength;}
void setwidth(int width){itswidth=width;}
int getwidth()const{return itswidth;}
private:
int itslength;
int itswidth;
};
Rectangle::Rectangle()
{
itswidth=5;
itslength=10;
}
Rectangle::~Rectangle()
{
}
int main()
{
Rectangle* prect=new Rectangle;
const Rectangle * pconstrect=new Rectangle;
Rectangle * const
}
来源:https://www.cnblogs.com/byeday/archive/2008/12/03/1346776.html