-1
#ifndef _RECT
#define _RECT

#include "Point.h"

using namespace std;

class Rectangle
{
private: 
    Point _topLeft;
    Point _bottomRight;
    int _color;

public:
    Rectangle( double left, double top, double width, double height, int color );
    ~Rectangle() { --m_count; };

public:
    int getColor() const;
    Point& getTopLeftPoint();

    Point& getBottomRightPoint();
    void setColor( int color );

public:
    bool contains( const Point &p );
    void moveRect( double deltaLeft, double deltaTop );
    void scaleRect( double rectWidth, double rectHeight );


    void setBigger(int x, int y) const;

public:
    static int m_count;
};

#endif

I didn't understand the meaning of the signatures:

Point& getTopLeftPoint();
Point& getBottomRightPoint();

Where do they belong,Is it another class constructor or is it another way to call the variables, I've been trying to figure out for hours

Thanks for the help

Sherry Bar
  • 11
  • 2
  • The functions return a reference to `Point` – Thomas Sablik Apr 04 '20 at 20:08
  • 1
    Identifiers beginning with an underscore followed by an uppercase letter, identifiers with a double underscore, and identifiers beginning with an underscore in global scope are reserved so using them is undefined behavior. You should change `_RECT`. – eesiraed Apr 04 '20 at 20:26

1 Answers1

1

This is elementary C++ language, so you might want to brush up your knowledge.

They are member functions (or methods, if you prefer the term) that return a reference to a Point. If you replace the return type Point & with for example int, the syntax should look familiar. Otheriwse, you really need to go back and learn the basics.

Aganju
  • 6,295
  • 1
  • 12
  • 23
  • Thanks for the orientation I just started learning the language and for a moment I didn't understand the meaning of it – Sherry Bar Apr 04 '20 at 20:13