Record Detail

Compile Error

/in/ex5.cpp: In constructor 'bookInventory::bookInventory()':
/in/ex5.cpp:10:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   for (int i = 0; i < this->size; i++) {
                   ~~^~~~~~~~~~~~
/in/ex5.cpp: In constructor 'bookInventory::bookInventory(int)':
/in/ex5.cpp:24:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   for (int i = 0; i < this->size; i++) {
                   ~~^~~~~~~~~~~~
/in/ex5.cpp: In member function 'void bookInventory::removeBook(int)':
/in/ex5.cpp:42:20: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   if (ID < 1 || ID > this->size) {
                 ~~~^~~~~~~~~~~~
/in/ex5.cpp:46:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   for (int i = ID; i < numBooks; i++) {
                    ~~^~~~~~~~~~
/in/ex5.cpp:50:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   for (int i = this->numBooks; i < this->size; i++) {
                                ~~^~~~~~~~~~~~
/in/ex5.cpp:55:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   for (int i = 0; i < size; i++) {
                   ~~^~~~~~
/in/ex5.cpp: In member function 'void bookInventory::printInventory() const':
/in/ex5.cpp:72:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   for (int i = 0; i < this->numBooks; i++) {
                   ~~^~~~~~~~~~~~~~~~
/in/ex5.cpp: In member function 'bool bookInventory::repOK()':
/in/ex5.cpp:82:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   for (int i = 0; i < this->size; i++) {
                   ~~^~~~~~~~~~~~
/in/ex5.cpp:93:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   for (int i = 0; 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
Exercise 5
Language
C++
Submit At
2024-11-26 19:25:43
Judged At
2024-11-26 19:25:43
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes