Record Detail

Compile Error

In file included from /in/Bus.cpp:1:0:
/in/compile/Bus.h: In constructor 'Bus::Bus(int)':
/in/compile/Bus.h:25:9: error: 'Bus::passengerNumMax' will be initialized after [-Werror=reorder]
     int passengerNumMax;
         ^~~~~~~~~~~~~~~
/in/compile/Bus.h:22:9: error:   'int Bus::passengerNum' [-Werror=reorder]
     int passengerNum;
         ^~~~~~~~~~~~
/in/Bus.cpp:4:1: error:   when initialized here [-Werror=reorder]
 Bus::Bus(int passengerNumMax) : passengerNumMax(passengerNumMax), passengerNum(0) {}
 ^~~
/in/Bus.cpp: At global scope:
/in/Bus.cpp:6:6: error: prototype for 'void Bus::print() const' does not match any in class 'Bus'
 void Bus::print() const {
      ^~~
In file included from /in/Bus.cpp:1:0:
/in/compile/Bus.h:12:10: error: candidate is: void Bus::print()
     void print();
          ^~~~~
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Lab11 Mon
Language
C++
Submit At
2024-08-07 19:46:54
Judged At
2024-08-07 19:46:54
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes