填空题
operator是运算符重载时必须使用的关键字,它和被重载的运算符连在一起,作为运算符函数的专用函数名,务必把该函数说明为【 】的。
【参考答案】
public
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
如下程序声明了一个二维图形类TwoDShape,从其派生出矩形类Rec。#include<iostream>#include<string>using namespaee std,class TwoDShape{ 二维图形类char name[20];public:TwoDShape (char * n= unknown ) {strcpy(name, n);}Char * getName(){return name;}【 】 =0;};class Rec: public TwoDShape{double width, heightpublic:Rec(double w-=0. 0,double h=0. 0):TwoDShape( rectangle ){ width=w; height=h; }double getWidth() {return width;}double getHeight() {return height;}double area() {return width * height;}};int main() {TwoDShape * shape;Shape=new Rec(2.1,3.0);cout<< object is <<shape->getName()<< n ;cout<< Area is <<shape->area()<< n ;return 0}请将程序补充完整,使程序在运行时输出:abject is triangleArea is 6.3
点击查看答案&解析
填空题
若按功能划分,软件测试的方法通常分为白盒测试方法和【 】测试方法。
点击查看答案&解析
相关试题
下列软件系统结构图的宽度为【 】
将一个函数声明为一个类的友元函数必须使用...
一个C++语言程序的开发步骤通常包括编辑...