形式参数和实在参数(Formal parameter and actual parameter).docVIP

  • 1009
  • 0
  • 约5.31千字
  • 约 7页
  • 2017-08-02 发布于河南
  • 举报

形式参数和实在参数(Formal parameter and actual parameter).doc

形式参数和实在参数(Formal parameter and actual parameter) Three, formal parameters and actual parameters Formal arguments: values, formal arguments, variables, formal arguments. When the function or process is defined, the parameter is the formal parameter. True argument: the arguments to function or procedure call are real arguments. 1, value formal parameter The function of a value parameter to receive data from the arguments corresponding to its location and to transmit data to the process or function that is in it. When a procedure or function is called, the system opens up a temporary storage unit for each value parameter, and assigns the value of the actual parameter to the formal parameter at the corresponding location, in the order from left to right. It should be emphasized that..: Type names can only be used in the parameter list and cannot be used in type. The value parameter and the corresponding argument must correspond to one another, including numbers and types. The data transfer between the argument and the value parameter is one-way, and can only be passed from the argument to the parameter. A special case is that when the task parameter is a real variable name, the corresponding argument can be an integer expression. A value parameter is used as a local quantity of a subroutine, and when the control (execution) returns the program, the memory unit of the value parameter is released. 2, variables, formal parameters You must add VAR to the name of the parameter name. The role of a variable parameter: a variable parameter can return the value generated during a subroutine call to the program that calls it, and then there are two possibilities: To determine the value of the argument has been receiving data from the corresponding argument variable parameter, the processing after the subroutine the value after the return to the main program, thus changing the argument value. In the calling procedure or function, the arguments do not determine the value of variabl

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档