Class Help

Can anybody help me figure out the purpose of having a const at the end of the member function and what would I expect to happen if I create a object of this class and call the getLinkedList() function on it.

As a side note there is another class called linkedListType which is used to create a list.

1
2
3
4
5
6
7
8
class customer
{
  public:
         linkedListType<string> getLinkedList() const ;

  private:
         linkedListType<string> list;
}
closed account (S6k9GNh0)
It means the function won't modify any variable of that instance of class "customer".
and what about calling the getLinkedList function ?? What could i expect from that
closed account (S6k9GNh0)
... All you can tell from that code above is that you know the function won't modify member variables. Most likely, based only on name, it would return the variable "list" (where it could then be modified by the user but NOT by the function).
Topic archived. No new replies allowed.