记录详情

Compile Error

foo.cc: In member function 'int Date::DayInMonth()':
foo.cc:23:8: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   23 |        else return 28; break;
      |        ^~~~
foo.cc:23:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
   23 |        else return 28; break;
      |                        ^~~~~
foo.cc: In function 'int main()':
foo.cc:57:19: error: 'Date::Date(int, int, int)' is private within this context
   57 |  Date date(y, m, d);
      |                   ^
foo.cc:14:2: note: declared private here
   14 |  Date(int y, int m, int d) {
      |  ^~~~
foo.cc:59:12: error: 'void Date::add(int)' is private within this context
   59 |  date.add(n);
      |            ^
foo.cc:38:7: note: declared private here
   38 |  void add(int n) {
      |       ^~~
foo.cc:60:14: error: 'void Date::Output()' is private within this context
   60 |  date.Output();
      |              ^
foo.cc:50:7: note: declared private here
   50 |  void Output() {
      |       ^~~~~~
foo.cc: In member function 'int Date::DayInMonth()':
foo.cc:37:2: warning: control reaches end of non-void function [-Wreturn-type]
   37 |  }
      |  ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1003 OO1-3 日期类Date
比赛
2022春 面向对象程序设计方法的上机作业
语言
C++
递交时间
2022-05-12 22:08:18
评测时间
2022-05-12 22:08:18
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes