Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <deque>
- #include <iterator>
- #include <string>
- #include <fstream>
- using namespace std;
- class Book
- {
- protected:
- deque<string> m_Book;
- public:
- Book(char* filename)
- {
- string a;
- ifstream file(filename,ios::in);
- while(!file.eof())
- {
- file>>a;
- m_Book.push_back(a);
- }
- }
- void print()
- {
- string c;
- for(int i=0;i<m_Book.size();i++)
- {
- c=m_Book[i];
- cout<<c<<" ";
- }
- }
- string& strToLower(string& s)
- {
- transform(s.begin(),s.end(),s.begin(),::tolower);
- return s;
- }
- void ToLower()
- {
- transform(m_Book.begin(),m_Book.end(),m_Book.begin(),strToLower);
- }
- };
- int main()
- {
- Book b("book.txt");
- b.print();
- }
Add Comment
Please, Sign In to add comment