Guest User

Untitled

a guest
Jan 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. class A
  2. {
  3. public:
  4. A(){}
  5. virtual ~A(){}
  6. virtual void out(std::ofstream& outFile) = 0;
  7. virtual void in(std::ifstream& inFile) = 0;
  8. };
  9.  
  10. class B : public A
  11. {
  12. public:
  13. B();
  14. double angle;
  15. int index;
  16.  
  17.  
  18. virtual void out(std::ofstream& outFile);
  19. virtual void in(std::ifstream& inFile);
  20.  
  21. };
  22.  
  23. virtual void out(std::ofstrea& outFile)
  24. {
  25. outFile<< index << angle;
  26. }
  27.  
  28. void B::out(std::ofstrea& outFile)
  29. {
  30. outFile<< index << angle;
  31. }
  32.  
  33. void B::out(std::ofstream& outFile)
  34. {
  35. outFile<< index << angle;
  36. }
  37.  
  38. void B::out(std::ofstream& out)
  39. {
  40. out << index << angle;
  41. }
  42.  
  43. void B::out(std::ofstrea& outFile) // Virtual keyword is optional in defintion.
  44. {
  45. // ...
  46. }
  47.  
  48. void B::out(std::ofstrea& outFile)
  49. {
  50. outFile<< index << angle;
  51. }
Add Comment
Please, Sign In to add comment