填空题
Staff类含有int 型数据成员ID,两个Staff 对象相等是指它们的ID相同。下面的函数重载了运算符==,它用来判断两个Staff 对象是否相等,相等时返回true,否则返回false。
请将横线处缺失部分补充完整。
bool Staff::Staff==(const Staff &s)return(
【14】
);
【参考答案】
ID==s. D 或 s. ID==ID 或 this->ID==s. ID 或 s. ID== this->ID
点击查看答案
<上一题
目录
下一题>
热门
试题
填空题
下面程序的运行结果是 【10】 。#include<iostream>using namespace std;class count static int n;public: count() n++; static int test() for(int i=0;i<4;i++) n++; return n; ;int count::n = 0;int main() cout<<count :: test()<< ; count c1, c2; cout<<count :: test()<<end1; return 0;
点击查看答案
填空题
下面程序的输出为 【11】 。#include <iostream.h>void main()int a[10],i, k=0;for(i=0,i<10;i++)a[i]=i;for(i=1;i<4;i++)k+=a[i]+i;cout<<k<<end1;
点击查看答案
相关试题
若有以下程序:#include <iostream>usi...
下列程序的输出结果为 【13】 。#incl...
以下程序的执行结果是 【12 。#includ...