Record Detail

Compile Error

In file included from /in/ex5.cpp:2:0:
/in/compile/ex5.h: In constructor 'bookInventory::bookInventory()':
/in/compile/ex5.h:41:16: error: 'bookInventory::size' will be initialized after [-Werror=reorder]
   unsigned int size;
                ^~~~
/in/compile/ex5.h:39:8: error:   'bool bookInventory::empty' [-Werror=reorder]
   bool empty;
        ^~~~~
/in/ex5.cpp:6:1: error:   when initialized here [-Werror=reorder]
 bookInventory::bookInventory(): numBooks(0), size(MAX_BOOKS),empty(true) {
 ^~~~~~~~~~~~~
In file included from /in/ex5.cpp:2:0:
/in/compile/ex5.h: In constructor 'bookInventory::bookInventory(int)':
/in/compile/ex5.h:37:16: error: 'bookInventory::numBooks' will be initialized after [-Werror=reorder]
   unsigned int numBooks;
                ^~~~~~~~
/in/compile/ex5.h:35:9: error:   'Book* bookInventory::books' [-Werror=reorder]
   Book *books;
         ^~~~~
/in/ex5.cpp:13:1: error:   when initialized here [-Werror=reorder]
 bookInventory::bookInventory(int maxBooks): numBooks(0), books(nullptr), size(maxBooks),empty(true) {
 ^~~~~~~~~~~~~
In file included from /in/ex5.cpp:2:0:
/in/compile/ex5.h:41:16: error: 'bookInventory::size' will be initialized after [-Werror=reorder]
   unsigned int size;
                ^~~~
/in/compile/ex5.h:39:8: error:   'bool bookInventory::empty' [-Werror=reorder]
   bool empty;
        ^~~~~
/in/ex5.cpp:13:1: error:   when initialized here [-Werror=reorder]
 bookInventory::bookInventory(int maxBooks): numBooks(0), books(nullptr), size(maxBooks),empty(true) {
 ^~~~~~~~~~~~~
/in/ex5.cpp: In member function 'bool bookInventory::repOK()':
/in/ex5.cpp:29:24: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      if (getNumBooks() > getSize()) {
          ~~~~~~~~~~~~~~^~~~~~~~~~~
/in/ex5.cpp: In member function 'void bookInventory::removeBook(int)':
/in/ex5.cpp:69:36: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for (int i = bookID - 1; i < numBooks - 1; i++) {
                                  ~~^~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
/in/compile/Makefile:26: recipe for target 'ex5.o' failed
make: *** [ex5.o] Error 1

Information

Submit By
Type
Submission
Homework
Exercise 5
Language
C++
Submit At
2024-11-27 12:17:29
Judged At
2024-11-27 12:17:29
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes