How to set reference function then call function in same time? [closed]

  c++

is possible to set member value directly with method reference, and call other method in same time? How to do this?

class Point
{
  int mX;
  
  public:
    int& setX()
    {
      return mX;
      
      getX();
    }
    
    void getX()
    {
      cout << mX;
    }
};

int main()
{
    Point p;
    p.setX() = 30;
    
    return 0;
}

Source: Windows Questions C++

LEAVE A COMMENT