正在加载图片...
OoP/ Slide 25 Default- Value Constructor A constructor is a special member function whose name is always the same as the name of the class Temperature:: Temperature(t degree =0.0 sca⊥e a constructor function initializes the data members when a Temperature object is declared Temperature temp3iOOP / Slide 25 Default-Value Constructor A constructor is a special member function whose name is always the same as the name of the class. Temperature::Temperature(){ degree = 0.0; scale = 'C'; } A constructor function initializes the data members when a Temperature object is declared. Temperature temp3;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有