Tech

Defining a Member Function With a Parameter-–C++ Notes (C Plus Plus Notes)

Defining a Member Function With a Parameter

  • A member function can require one or more parameters that represent additional data it needs to perform its task. A function call will supply arguments for each parameter.
  • A member function is called by following the object name with a dot operator (.), the function name, and a set of parenthesis containing the function’s arguments.
  • A parameter list may contain any number of parameters, including none at all (represented by empty parentheses) to indicate that a function does not require any parameters.
  • The number and types of arguments in a function call must match the number & types of the parameter list.