ok i put STATIC in front of a DATE and TIME member as belo
in Event.h
Code:
#ifndef _EVENT_H_
#define _EVENT_H_
class Time;
class Date;
class Event
{
private:
static Date inputDate;
static Time startTime;
int inputTimeInterval;
static Time endTime;
std::string eventName;
std::string eventLocation;
std::string eventComments;
public:
Event();
void printEvent();
//void set_inputDate()
};
#endif
in Event.cc
now compiler doesnt complain about (i dont know DATE undeclred type etc etc...)
ive the Event initialized as follows
Code:
Event::Event(): inputDate(SimpleInput::ReadDate("Please Enter Date: ")),
startTime(SimpleInput::ReadTime("Enter Event Start Time (hh:mm 24hr format): ")),
inputTimeInterval(SimpleInput::ReadInteger("Please Enter The Time (in minutes) Interval for Event: ")),
eventName(SimpleInput::ReadLine("What's the Event Name: ")),
eventLocation(SimpleInput::ReadLine("What's the Event Location: ")),
eventComments(SimpleInput::ReadLine("Any Comments: "))
{
//adds timeInterval to get endTime
int mhours= inputTimeInterval/60;
int mminutes= inputTimeInterval%60;
int hours= startTime.getHour();
int minutes= startTime.getMinute();
int endHour = hours+mhours;
int endMinute = minutes+mminutes;
if (endMinute>59)
{
endMinute = endMinute - 60;
endHour = endHour + 1;
}
//gives endTime of an event
this->endTime = Time(endHour, endMinute);
}
all other things are correct just this error is coming 2 times...
event.cpp(17) : error C2614: 'Event' : illegal member initialization: '<Unknown>' is not a base or member
While cpp(17 ) refers to line where { bracket of Event constructor starts