previous | start | next

## Member Functions

- Each member function advertised in the class interface must be implemented separately.
- A `Class_name``::` prefix makes it clear that we are defining a member function for that class.

  >     void Product::read()
  >     {
  >        cout << "Please enter the model name: ";
  >        getline(cin, name);
  >        cout << "Please enter the price: ";
  >        cin >> price;
  >        cout << "Please enter the score: ";
  >        cin >> score;
  >        string remainder; /* read the remainder of the line */
  >        getline(cin, remainder);
  >     }

- It is perfectly legal to have member functions in other classes as well; it is important to specify exactly which function goes with which class.
- A member function is called `object``.function_name()`.

  >     next.read();

previous | start | next