Hi, I've got a problem with initialize list which include elements of the structure.
Content of the calendar.h file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
struct Date {
int day;
int month;
int year;
};
class calendar{
private:
struct Date date;
int week_day;
public:
calendar();
calendar(const calendar&);
calendar( int, int, int);
};
Content of the calendar.cpp:
1 2
#include "calendar.h"
calendar::calendar(int d, int m, int y) : date.day(d), date.month(m), date.year(y) {}
These are errors i got:
expected '(' before '.' token calendar.cpp /rogus1 line 5 C/C++ Problem
expected '{' before '.' token calendar.cpp /rogus1 line 5 C/C++ Problem
expected unqualified-id before '.' token calendar.cpp /rogus1 line 5 C/C++ Problem