Advertisement
icatalin

Rectangle.cpp

Oct 16th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #include <stdafx.h>
  2. #include <Rectangle.h>
  3.  
  4. Rectangle::Rectangle(int width, int height)
  5. {
  6.     : m_width(width)
  7.     , m_height(height)
  8. }
  9.  
  10. void Rectangle::SetWidth(const int width)
  11. {
  12.     m_width = width;
  13. }
  14.  
  15. int Rectangle::GetWidth() const
  16. {
  17.     return m_width;
  18. }
  19.  
  20. void Rectangle::SetWidth(const int width)
  21. {
  22.     m_width = width;
  23. }
  24.  
  25.  
  26. bool Rectangle::operator!=(const Rectangle& second) const //neterminat
  27. {
  28.     return m_height == second.m_height && first.m_width == second.m_width
  29. }
  30.  
  31. bool operator==(const Complex & first, const Rectangle & second)
  32. {
  33.     return first.m_height == second.m_height && first.m_width == second.m_width;
  34. }
  35.  
  36. std::istream & operator>>(std::istream& stream, Rectangle & rectangle)
  37. {
  38.     stream >> rectangle.m_width >> rectangle.m_height;
  39.     return stream;
  40. }
  41.  
  42. std::ostream& operator<<(std::ostream& stream, const Rectangle& rectangle)
  43. {
  44.     stream << rectangle.m_with << rectangle.m_height;
  45.     return stream;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement