记录详情

Compile Error

/in/foo.cc: In constructor 'Date::Date(int, int, int)':
/in/foo.cc:26:6: warning: 'Date::year' will be initialized after [-Wreorder]
  int year;
      ^~~~
/in/foo.cc:24:6: warning:   'int Date::month' [-Wreorder]
  int month;
      ^~~~~
/in/foo.cc:11:2: warning:   when initialized here [-Wreorder]
  Date(int m = 1, int d = 1, int y = 2000):year(y),month(m),day(d){}
  ^~~~
/in/foo.cc: In copy constructor 'Date::Date(const Date&)':
/in/foo.cc:25:6: warning: 'Date::day' will be initialized after [-Wreorder]
  int day;
      ^~~
/in/foo.cc:24:6: warning:   'int Date::month' [-Wreorder]
  int month;
      ^~~~~
/in/foo.cc:20:2: warning:   when initialized here [-Wreorder]
  Date(const Date& d) :day(d.day), month(d.month), year(d.year){}
  ^~~~
/in/foo.cc: In member function 'double Employee::getpay(int)':
/in/foo.cc:64:62: error: invalid use of member function 'int Date::getMonth()' (did you forget the '()' ?)
  double getpay(int mouth) { return pay + (mouth == birthDate.getMonth ? 100 : 0); }
                                                    ~~~~~~~~~~^~~~~~~~

信息

递交者
类型
递交
题目
P1007 12.12 Payroll System Modification
语言
C++
递交时间
2020-03-27 20:50:23
评测时间
2020-03-27 20:50:23
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes