Simple invocation of a function

Source: Internet
Author: User

1#include <stdio.h>2#include <string.h>3#include <windows.h>4 intMove ();5 intBulid ();6 intPaint ();7 intMain ()8 {9 Move ();Ten Bulid (); One Paint (); A      -     return 0; - } the intMove () - { -printf"call transport function \ n");  - } + intBulid () - { +printf"call the build function \ n"); A } at intPaint () - { -printf"call the paint function \ n"); -}

Implementation and invocation of a simple function of addition functions

1#include <stdio.h>2 intAddintNumber1,intNUMBER2);//declares that the Add function function is used to calculate the addition3 intMain ()4 {5     inta,b,sum;6scanf"%d%d",&a,&b);7Sum=add (A, b);//use the values of A and B as arguments to the function8printf"%d", sum);9     return 0;Ten } One  A intAddintNumber1,intNumber2)//Definition of function - { -     intresult; theresult=number1+Number2; -     returnResult//Use the result of the calculation as the return value of the function -}

1#include <stdio.h>2 CharShowchar ();3 intMain ()4 {5     CharCresult;6cresult=Showchar ();7printf"%c\n", Cresult);8     return 0;9 }Ten CharShowchar () One { A     intInumber; -printf"Please input a number \ n"); -scanf"%d",&inumber); the     returnInumber; - } - /* - program function: Get a number by the Showchar function and convert the ASCII code to the corresponding character return to the Cresult in the main function and print it out . +It is important to note that the type of the return value of the function is the type of the function that you define - */

The argument and formal parameter of a function is a very simple thing parameter is the argument of any value is very simple thing book inside actually use milk xx a lot of nonsense to say this or Hao bin teacher said to take the reality of things in the program this is no egg use

Simple invocation of a function

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.