Record Detail

Compile Error

In file included from /in/ex5.cpp:1:0:
/in/compile/ex5.h: In constructor 'bookInventory::bookInventory()':
/in/compile/ex5.h:37:16: error: 'bookInventory::size' will be initialized after [-Werror=reorder]
   unsigned int size;
                ^~~~
/in/compile/ex5.h:35:8: error:   'bool bookInventory::empty' [-Werror=reorder]
   bool empty;
        ^~~~~
/in/ex5.cpp:3:1: error:   when initialized here [-Werror=reorder]
 bookInventory::bookInventory() : 
 ^~~~~~~~~~~~~
/in/ex5.cpp:6:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < size; i++)
                    ~~^~~~~~
In file included from /in/ex5.cpp:1:0:
/in/compile/ex5.h: In constructor 'bookInventory::bookInventory(int)':
/in/compile/ex5.h:37:16: error: 'bookInventory::size' will be initialized after [-Werror=reorder]
   unsigned int size;
                ^~~~
/in/compile/ex5.h:35:8: error:   'bool bookInventory::empty' [-Werror=reorder]
   bool empty;
        ^~~~~
/in/ex5.cpp:10:1: error:   when initialized here [-Werror=reorder]
 bookInventory::bookInventory(int maxBooks) :
 ^~~~~~~~~~~~~
/in/ex5.cpp:17:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < size; i++)
                    ~~^~~~~~
/in/ex5.cpp: In member function 'bool bookInventory::repOK()':
/in/ex5.cpp:69:14: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if(empty = 1){
        ~~~~~~^~~
/in/ex5.cpp:71:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for(int i = 0; i < size; i++){
                        ~~^~~~~~
/in/ex5.cpp:77:14: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if(empty = 0){
        ~~~~~~^~~
/in/ex5.cpp:79:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for(int i = 0; i < numBooks; i++){
                        ~~^~~~~~~~~~
/in/ex5.cpp:84:33: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for(int i = numBooks; i < size; 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
Exercise5
Language
C++
Submit At
2024-04-11 19:01:49
Judged At
2024-04-11 19:01:49
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes