I'm trying to do the following:
class Book {
std::string m_title;
std::string m_author;
int m_noPages;
public:
Book(const std::istream& is) {
std::string bookString;
is >> bookString;
// ...
}
};
... After this, I will proceed to separate the is input into m_title, m_author, and m_noPages, but why won't the two lines above inside the constructor work?