title: C++:: Call class method using vector iterator?
body: <p>I have a class called Room, the Room class has setPrice and display function.</p>
  
  <p>I stored room objects in a vector:</p>
  
  <pre><code>room.push_back(Room("r001", 1004, 2, "small"));
  room.push_back(Room("r002", 1005, 2, "small"));
  room.push_back(Room("r003", 2001, 4, "small"));
  room.push_back(Room("r004", 2002, 4, "small"));
  </code></pre>
  
  <p>In my main function, i create a display function to display all rooms. Here is my code:</p>
  
  <pre><code>void displayRoom()
  {
      vector&lt;Room&gt;::iterator it;
      for (it = room.begin(); it != room.end(); ++it) {
           *it.display(); // just trying my luck to see if it works
      }
  }
  </code></pre>
  
  <p>But it does not call the Room's display method.</p>
  
  <p>How do I call the Room(class)'s display method (no argument) and setPrice(1 argument) method?</p>