我正在尝试调用构造函数,但它不起作用。代码是这样的:
// 事件.h
class Event
{
private:
int Time;
int Date;
public:
Event();
Event(int t, int d)
}
// 事件.cpp
Event::Event(){}
Event::Event(int time, int date){
Time=time;
Date=date;
}
//现在在另一个 .cpp 文件中,我试图调用构造函数,如下所示:
Event eve;
eve(inputTime,inputDate); // inputTime and inputDate are inputs 4m user.
//Error is: no match for call to â(Event) (Time&, Date&)â
有什么建议么..............