class Line
{
public:
Line(double len);//构造函数声明
~Line();//析构函数声明,析构函数不返回任何值,也不带参数,有助于在跳出程序前释放资源
private:
double length;
}
Line::Line(double len): length(len){}
//相当于
/*
Line::Line(double len)
{
length = len;
}
*/