Home Segments Index Top Previous Next

162: Mainline

By convention, small but important changes in syntax distinguish member-function calls from calls to ordinary functions. In particular, each member function has one special argument:

For example, to call the volume function—the one that is a member of the box_car class—to work a box_car object named by a variable, x, you write the following:

x.volume ( ) 

Note that the volume member function happens to have no ordinary arguments.