Hi everyone,
I'm working on a scheduler program and am getting the following error when I try to compile: "error: expected ‘;’ before ‘<’ token"
Here is the code that is causing trouble:
#ifndef SCHEDULE_H
#define SCHEDULE_H
#include "ScheduleBase.h"
class Schedule : public ScheduleBase{
class Event{
int year;
int mon;
int day;
int hour;
int lengthHours;
std::string title;
}
vector<Event> mySchedule;***
public:
bool add(int year, int mon, int day, int hour, int length, const std::string &title);
bool add(const std::string &);
void clear();
int size() const;
private:
friend std::ostream &operator<<(std::ostream &, const ScheduleBase &);
void print(std::ostream &) const;
};
#endif /*SCHEDULE_H*/
*** indicates the line that is having problems (no that's not in my real code)
Please let me know if you see what I'm missing!
Thanks!
You need #include <vector>
And it should be std::vector<Event>
huh that was silly of me... thank you :)