Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include "Square.h"
  2. #include "tools.hpp"
  3.  
  4. ostream&
  5. Square :: print(ostream& s)
  6. {
  7. return s << "Square [" << row << " " << column << "]" << endl;
  8. }
  9.  
  10. ostream&
  11. SqState :: print(ostream& sq)
  12. {
  13.  
  14. return sq << "value: " << sq_value;
  15. }
  16. void testSquare();
  17. void testSqState();
  18. int main()
  19. {
  20. banner();
  21.  
  22. testSquare();
  23. testSqState();
  24. bye();
  25.  
  26. }
  27.  
  28. void testSqState()
  29. {
  30. SqState sq('-', 4, 0);
  31. sq.print(ostream s); // << Error occurs here
  32. }
  33.  
  34. void testSquare()
  35. {
  36. Square s(4, 0);
  37. s.print(ostream st); // << Error occurs here
  38. }
  39.  
  40. SqState sq('-', 4, 0);
  41. sq.print(ostream s);
  42.  
  43. ostream&
  44. SqState :: print(ostream& sq)
  45. {
  46.  
  47. return sq << "value: " << sq_value;
  48. }
  49.  
  50. sq.print(std::cout);
  51.  
  52. void testSqState() {
  53. SqState sq('-', 4, 0);
  54. sq.print(std::cout);
  55. }
  56.  
  57. void testSquare() {
  58. Square s(4, 0);
  59. s.print(std::cout);
  60. }
  61.  
  62. **sq.print(ostream s);**
  63. **s.print(ostream st);**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement