填空题

假定用户没有给一个名为MyClass的类定义析构函数,则系统为其定义的默认析构函数首部形式为上 【7】 。

【参考答案】

~MyClass()
<上一题 目录 下一题>
热门 试题

填空题
虚函数必须是类的 【12】 。
填空题
以下程序运行后的输出结果是 【10】 。 #include <iostream> #include <string> using namespace std; class Y; class X iht x; char *strx; public: X(int a,char *str) x=a; strx=new char[strlen(str)+1]; strcpy(strx,str); void show(Y &ob); ; class Y private: iht y; char *stry; public: Y(int b,char *str) y=b; stry=new char[strlen(str)+ 1] ; strcpy(stry, str); friend void X::show(Y &ob); ; void X::show(Y &ob) cout<<strx<< , ; cout<<ob.stry<<endl; int main() X a(10, stringX ); Y b(20, stringY ); a.show(b); return 0;
相关试题
  • 【13】 允许用户为类定义一种模式,使得...
  • 有以下程序: #include <iostream> u...
  • 下面是复数类complex的定义,其中作为友元...
  • 数据库系统中实现各种数据管理功能的核心软...
  • 在下面横线上填上适当的语句,完成程序。 ...