How to call function code in C Language

Source: Internet
Author: User

The following is an example of calling the function code.

Example 1:
Try (int I) <---- I: formal Parameter
{
.......
}
Main ()
{
Int number = 1; <---- This is the value of the actual parameter number, that is, the value passed to the form parameter base, which is 1.
Try (number); <----- number: actual Parameter
}
C422.jpg (2661 bytes) can be a constant, variable, or even an expression.

Example 2:
Try (int base)
{
Base = base 5;
}
Main ()
{
Int number = 1;
Try (number );
}
In the preceding example, the parameter number and the format parameter base occupy different memory locations.

Example 3:
Main ()
{
Float duff (int);/* description in the called function */
Int n;
Float q;
...
Q = duff (n );
...
}
Float duff (int k)/* description in function definition */
{
Float tor;
...
Return (tor);/* returns a float value */
}

In calling a function, the description of the called function can only include parentheses and parameter types to distinguish it from a function.
C421.jpg (2871 bytes) when calling a function with formal parameters, we use actual parameters. The actual parameter is a special value assigned to the corresponding formal parameter during the call.

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.