The task, like a book library. There is a class book that lists the author, title, year of publication. I want to create a separate class DataBase where the presence of the books will be listed exclusively. Is it possible to create a vector initialized class Book? That is, at a time enter the name, author, year.
1. define the overloaded ctor: Book (const string& autor, const string& title, int year)
2. remove the Book argument to Database::m_book() as it is superflous
3. declare a local std::vector<Book> that Database::m_book() would return
4. push_back above vector<Book> with Book objects created using the overloaded ctor
5. unless your ctors are acquiring resources (through new operator for eg) you don't need to explicitly define a dtor
6. I haven't removed all references to them but using namespace std is a bad idea: http://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice