previous | start | next

Comparing Member Functions with Nonmember Functions

Explicit Parameter Implicit Parameter
Value Parameter
(not changed)
Default
Example: void print(Employee)
Use const
Example: void Employee::print()const
Reference Parameter
(can be changed)

Use &
Example: void raiseSalary(Employee & e, double p)

Default
Example: void Employee::raiseSalary(double p)

 



previous | start | next