Record Detail

Compile Error

/in/ex4.cpp: In member function 'virtual void bookInventory::printInventory() const':
/in/ex4.cpp:60:14: error: 'cout' is not a member of 'std'
         std::cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << "\n" << "Available: " << (books[i].isAvailable ? "Yes" : "No") << std::endl;
              ^~~~
/in/ex4.cpp:60:14: note: suggested alternative: 'copy'
         std::cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << "\n" << "Available: " << (books[i].isAvailable ? "Yes" : "No") << std::endl;
              ^~~~
              copy
/in/ex4.cpp:60:197: error: 'endl' is not a member of 'std'
         std::cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << "\n" << "Available: " << (books[i].isAvailable ? "Yes" : "No") << std::endl;
                                                                                                                                                                                                     ^~~~
/in/ex4.cpp:60:197: note: suggested alternative: 'end'
         std::cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << "\n" << "Available: " << (books[i].isAvailable ? "Yes" : "No") << std::endl;
                                                                                                                                                                                                     ^~~~
                                                                                                                                                                                                     end
/in/ex4.cpp: In member function 'void library::listBorrowed() const':
/in/ex4.cpp:90:18: error: 'cout' is not a member of 'std'
             std::cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << std::endl;
                  ^~~~
/in/ex4.cpp:90:18: note: suggested alternative: 'copy'
             std::cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << std::endl;
                  ^~~~
                  copy
/in/ex4.cpp:90:135: error: 'endl' is not a member of 'std'
             std::cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << std::endl;
                                                                                                                                       ^~~~
/in/ex4.cpp:90:135: note: suggested alternative: 'end'
             std::cout << "Book ID: " << i + 1 << "\n" << "Title: " << books[i].title << "\n" << "Author: " << books[i].author << std::endl;
                                                                                                                                       ^~~~
                                                                                                                                       end
/in/compile/Makefile:26: recipe for target 'ex4.o' failed
make: *** [ex4.o] Error 1

Information

Submit By
Type
Submission
Homework
Exercise 4
Language
C++
Submit At
2024-11-20 16:22:35
Judged At
2024-11-20 16:22:35
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes