单项选择题
有以下程序:
Class Date
public:
Date(int y,int m,mt d);
year=y;
month=m;
day=d;
Date(int y=2000)
year=y;
month=10;
day=1;
Date(Date &d)
year=d.year;
month=d.month;
day=d.day;
Void print()
cout<<year<<"."<<month<<"."<<day<<endl;
private:
int year,month,day;
;
Date fun(Date d)
Date temp;
temp=d;
return temp;
mt main()
Date date1(2000,1,1),date2(0,0,0);
Date date3(datel);
date2=fun(date3);
return 0;
程序执行时,Date类的拷贝构造函数被调用的次数是( )。
A.2
B.3
C.4
D.5
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
如有下程序: #include<iostream> using namespace std; long fun(int n) if(n>2) return(fun(n-1)+fun(n-2)); else return 2; int main() cout<<fun(3)<<endl; return 0; 则该程序的输出结果应该是( )。
A.2
B.3
C.4.
D.5
点击查看答案&解析
单项选择题
有如下程序 #include<iostream.h> void main() char ch[2][5]== 6937 , 8254 ,*p[2]; int i,j,s=0; for(i=0;i(2;i++)p[i]=ch[i]; for(i=0;i(2;i++) for(j=0;p[i][j]>’ 0,j+=2) s=10*s+p[i][j]-’0’; cout<<s; 该程序的输出结果是( )。
A.69825
B.63825
C.6385
D.693825
点击查看答案&解析
相关试题
表达式c3=c1.operator+(c2)或c3=...
程序中有如下语句: for(int i=0;i<...
下列程序在构造函数和析构函数中申请和释放...
用以下语句调用库函数malloc,使字符指针st...
有如下定义: Class MA int value; p...