C-Language Foundation--form participates in the argument

Source: Internet
Author: User
Formal parameters: All called "formal arguments" are parameters that are used when defining function names and body functions to receive the arguments passed when the function is called. The function of formal parameters is to realize the relation between the key function and the modulated function, usually the data processed by the function, the factors affecting function function or the result of the function processing as the formal parameter. Functions that do not have formal parameters should be written in the position of the formal parameter list Void.main function can also be a physical parameter and return value, whose formal parameter is also called the command line parameter, the operating system is initialized when the program starts, and its return value is passed to the operating system. Arguments: Can be constants, variables, expressions, functions, and so on, regardless of the amount of the actual argument, they must have a definite value when making a function call to pass these values to the parameter. Therefore, an assignment, input, and so on should be used to obtain a definite value for the argument. Differences between arguments and formal parameters: blank or Placeholder 1. The formal parameters of the function are listed in the function declaration and are used within the function defined by the function body. When a function is called, the formal parameter (any kind of) is a type of blank or placeholder that will be filled. Used to fill formal parameter 2. The arguments are used to fill the parameters. When a function is called, the argument is listed in parentheses after the function name. When a function call is executed, the argument is passed to the parameter. An argument is an expression that has a definite value. The value call and the reference call 3. Call-to-value and reference calls refer to a mechanism used in the parameter passing process. The value of the argument is used only in a value call. In the invocation mechanism of a value, the formal parameter is a local variable whose initial value is the value of the corresponding argument. In the reference invocation mechanism, the address of the argument is passed to the formal parameter, and on the surface it is replaced by a real parametric, so any change that occurs on the formal parameter actually occurs on the real parametric. a row parameter is a parameter that is placed in parentheses after the function name when the function is defined. When a function call is not made, the row parameter is not assigned an internal deposit element. In the event of a function call, the row parameter is immediately assigned an inner deposit element. At the end of the call, the memory unit that the row parameter occupies is freed. a row parameter belongs to a local variable, and its scope is in the function it resides in.

C-Language Foundation--form participates in the argument

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.