title: Non-standard syntax; use '&' to create a pointer member. Error on display function c++
body: <p>I am trying to get a display function to hold the information from the floats and when I try to run the program it gives me the error "Non-standard syntax; use '&amp;" to create a pointer member" and then I add the '&amp;' to the floats and make them pointers and it gives me the error "'&amp;': illegal operation on bound member function expression. I dont know why it wont work.</p>
  
  <p>heres my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;conio.h&gt;
  
  using namespace std;
  
  
  class Rectangle
  {
  
  public:
  
  //constructor
  Rectangle() { }
  
  
  //accessor
  float GetHeight() { return m_height; } const
  float GetWidth() { return m_width; } const
  
  float GetArea() { return m_height * m_width; }
  
  float GetPerimeter() { return m_height + m_height + m_width + m_width; }
  
  //mutator
  void SetHeight(float h)
  {
      cout &lt;&lt; "Please Enter height: \n";
      cin &gt;&gt; h;
  
  };
  
  void SetWidth(float w)
  {
      cout &lt;&lt; "Please Enter the width: \n";
      cin &gt;&gt; w;
  }
  
  
  void Display()
  {
      cout &lt;&lt; "Height: " &lt;&lt; GetHeight &lt;&lt; " " &lt;&lt; "Width: " &lt;&lt; GetWidth &lt;&lt; " " &lt;&lt; "Area: " &lt;&lt; GetArea &lt;&lt; " " &lt;&lt; "Perimeter: " &lt;&lt; GetPerimeter &lt;&lt; endl;
  
  };
  
  
  
  private:
  
  float m_height;
  float m_width;
  
  };
  
  
  
     using namespace std;
  
  int main()
  {
      Rectangle r;
      float height = 0;
      float width = 0;
      r.SetHeight(height);
      r.SetWidth(width);
  
      r.Display();
  
  
  
  
  
      _getch();
      return 0;
  }
  </code></pre>