C-04 function,-04 Function

Source: Internet
Author: User

C-04 function,-04 Function
1. Parameters

Parameter notes
1. Formal parameters: when defining a function, the parameters following the function name are referred to as form parameters.
2. Actual parameters: Specific data passed in by calling the function, referred to as real parameters
3. The number of real parameters must be equal to the number of shape parameters.
4. The function body cannot define variables with the same parameters.
5. If the basic data type is used as the function parameter, it is purely a value transfer. Modifying the value of the internal function parameter does not affect the value of the external parameter.
6. A function can have no shape parameters or an unlimited number of shape parameters.

2. Return Value

Function of return:
1> exit the Function
2> return a specific value to the function caller.

Notes on returned values
1> void indicates no return value
2> If the return value type is not explicitly stated, int type is returned by default.
3> even if the return value type is explicitly declared, no value is returned.

By default, the C language does not allow two functions to have the same name.

3. # include <file name. Extension> system's "file name. Extension" Custom

The include statement copies the function declaration to prevent warnings during compilation.

Cc. File Name. o links the definition of the system library function when linking.

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.