Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. ostream& ClassObject::output(ostream& os) const
  2. {
  3. os << "Details";
  4. return os;
  5. }
  6.  
  7. #include "ClassObject"
  8. #include <fstream>
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13. int main()
  14. {
  15. ClassObject ob;
  16. cout << ob; // print info to console window
  17.  
  18. // save info to .txt file
  19. ofstream fileout;
  20. fileout.open("filename.txt", ios::app);
  21. fileout << ob;
  22. fileout.close();
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement