单项选择题
实现运行时的多态性用
A.重载函数
B.构造函数
C.析构函数
D.虚函数
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
下列程序的输出结果是 【7】 。# include<iostream. h>void main() char a[]= abcdabcabfgacd int i1=0,i2=0,i=0; while (a[i]) if (a[i]= a ) i1++; if (a[i]== b ) i2++; i++; cout <<i1<< <<i2<<end1;
点击查看答案&解析
填空题
下列程序中需要清理动态分配的数组,划线处应有的语句是 【13】 。#include<iostream, h>class person int age, tall;public: person() age= 0; tall= 40; cout<< A baby is born. <<end1; person(int i) age=i, tall=40, cout<< A old person. <<end1; person(int i, int i) age = i; tall = j; cout << a old person with tall. << end1; ~person( ) cout<< person dead. <<end 1; void show() cout<< age= <<age<< ,tall= <<tall<<end1;;void main() person * ptr; ptr = new person[3]; ptr[0]=person ( ) ptr[1]=person(18); ptr[2]=person(20,120); for(int i=0;i<3; i++) ptr[i]. show( ); ______
点击查看答案&解析
相关试题
下列程序的运行结果是 【9】 。#includ...
下列程序的执行结果是 【12】 。#incl...
下列程序的输出结果是非曲直 【15】 。...
下面程序编译时发现ma[3]=9错误,其原...
下列程序中需要清理动态分配的数组,划线处...