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