记录详情

Compile Error

/in/foo.cc:8:24: error: expected ';' at end of member declaration
  time(int h,int m,int s) h(h),m(m),s(s){}
                        ^
/in/foo.cc:8:28: error: 'h' is not a type
  time(int h,int m,int s) h(h),m(m),s(s){}
                            ^
/in/foo.cc:8:29: error: ISO C++ forbids declaration of 'h' with no type [-fpermissive]
  time(int h,int m,int s) h(h),m(m),s(s){}
                             ^
/in/foo.cc:8:30: error: 'int time::h(int)' conflicts with a previous declaration
  time(int h,int m,int s) h(h),m(m),s(s){}
                              ^
/in/foo.cc:6:6: note: previous declaration 'int time::h'
  int h,m,s;
      ^
/in/foo.cc:8:33: error: 'm' is not a type
  time(int h,int m,int s) h(h),m(m),s(s){}
                                 ^
/in/foo.cc:8:34: error: ISO C++ forbids declaration of 'm' with no type [-fpermissive]
  time(int h,int m,int s) h(h),m(m),s(s){}
                                  ^
/in/foo.cc:8:35: error: 'int time::m(int)' conflicts with a previous declaration
  time(int h,int m,int s) h(h),m(m),s(s){}
                                   ^
/in/foo.cc:6:8: note: previous declaration 'int time::m'
  int h,m,s;
        ^
/in/foo.cc:8:38: error: 's' is not a type
  time(int h,int m,int s) h(h),m(m),s(s){}
                                      ^
/in/foo.cc:8:39: error: ISO C++ forbids declaration of 's' with no type [-fpermissive]
  time(int h,int m,int s) h(h),m(m),s(s){}
                                       ^
/in/foo.cc:8:41: error: 'int time::s(int)' conflicts with a previous declaration
  time(int h,int m,int s) h(h),m(m),s(s){}
                                         ^
/in/foo.cc:6:10: note: previous declaration 'int time::s'
  int h,m,s;
          ^
/in/foo.cc: In member function 'int time::s(int)':
/in/foo.cc:8:41: warning: no return statement in function returning non-void [-Wreturn-type]
  time(int h,int m,int s) h(h),m(m),s(s){}
                                         ^
/in/foo.cc: In member function 'int time::function(time)':
/in/foo.cc:14:13: error: invalid use of member function 'int time::h(int)' (did you forget the '()' ?)
  return ((b.h-this->h)*3600+(b.m-this->m)*60+(b.s-this->s));
           ~~^
/in/foo.cc:14:21: error: invalid use of member function 'int time::h(int)' (did you forget the '()' ?)
  return ((b.h-this->h)*3600+(b.m-this->m)*60+(b.s-this->s));
               ~~~~~~^
/in/foo.cc:14:32: error: invalid use of member function 'int time::m(int)' (did you forget the '()' ?)
  return ((b.h-this->h)*3600+(b.m-this->m)*60+(b.s-this->s));
                              ~~^
/in/foo.cc:14:40: error: invalid use of member function 'int time::m(int)' (did you forget the '()' ?)
  return ((b.h-this->h)*3600+(b.m-this->m)*60+(b.s-this->s));
                                  ~~~~~~^
/in/foo.cc:14:49: error: invalid use of member function 'int time::s(int)' (did you forget the '()' ?)
  return ((b.h-this->h)*3600+(b.m-this->m)*60+(b.s-this->s));
                                               ~~^
/in/foo.cc:14:57: error: invalid use of member function 'int time::s(int)' (did you forget the '()' ?)
  return ((b.h-this->h)*3600+(b.m-this->m)*60+(b.s-this->s));
                                                   ~~~~~~^
/in/foo.cc: In function 'int main()':
/in/foo.cc:22:7: error: expected ';' before 'a'
  time a(h1,m1,s1);
       ^
/in/foo.cc:22:18: warning: statement is a reference, not call, to function 'time' [-Waddress]
  time a(h1,m1,s1);
                  ^
/in/foo.cc:22:18: warning: statement has no effect [-Wunused-value]
/in/foo.cc:23:7: error: expected ';' before 'b'
  time b(h2,m2,s2);
       ^
/in/foo.cc:23:18: warning: statement is a reference, not call, to function 'time' [-Waddress]
  time b(h2,m2,s2);
                  ^
/in/foo.cc:23:18: warning: statement has no effect [-Wunused-value]
/in/foo.cc:24:4: error: 'a' was not declared in this scope
  c=a.function(b);
    ^
/in/foo.cc:24:15: error: 'b' was not declared in this scope
  c=a.function(b);
               ^

信息

递交者
类型
递交
题目
P1001 OO1-2 时间类Time
比赛
《面向对象的程序设计方法》的课程测验
语言
C++
递交时间
2021-06-22 11:26:47
评测时间
2021-06-22 11:26:47
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes