Font size

Function call

Function calls are described in the section Functions. It is worth adding that, even if a function does return a value, it still can be called as a statement if the returned value is not needed. For example, the following statement removes a person from the list of friends:

friends.remove( victor );

The function remove() returns true if the object being removed was contained in the list. If we are sure it was there (or if we do not care if it was) we can throw away the returned value.

How can we improve this article?