各位编程大大,指点一下小弟
江湖救急啊,老师出了两条题,各位大哥指点一下吧,都是改错题,要找出程序的错误,并注释一下错误的原因1.
class Time
{ public:
Time(int day){ iMonth=5; iDay=day; iYear=2000; }
Timt(int month, int day=7 ) { iMonth=month; iDay=day; iYear=2000; }
Private:
int iMonth; int iDay; int iYear;
};
void main()
{ Time input(9,1,2005);
input.iMonth=1;
}
2.
Template<class T>
Type func ( T a , T b )
{ return ( a > b ? a : b ); }
#include<iostream.h>
void main()
{ int a=3 ; double x=3.5 ;
cout<<func(a,x)<<endl;
}