#include <stdio.h>
/*
Parameter Note points
1. Formal parameters: A parameter that is followed by a function name when defining a function, for short, a formal parameter
2. Actual parameters: Call the function of the specific data passed in, referred to as an argument
3. The number of arguments must be equal to the number of formal parameters
4. Variables within the function body that cannot be defined as parameters
5. If the base data type is a function parameter, it is purely a value pass, modifying the value of a function's internal parameter without affecting the value of the outer argument
6. A function can have no formal parameters, or can have an infinite number of parameters
*/
Formal parameters, referred to as formal parameter
int sum (int num1,int num2)
{
The function body cannot define the same variables as the parameters
int num1;
NUM1 = 50;
return NUM1 + num2;
}
/*
The function of return:
1> Exit Function
2> returns a specific value to the function caller
Return value Note point
1> void represents no return value
2> If the return value type is not explicitly stated, the default is to return the int type
3> even if the return value type is explicitly declared, no value can be returned
By default, the C language does not allow the same names as two functions
*/
Char Test ()
{
Return ' A ';
}
/*
void Test (int a, int b)
{
}*/
void Test5 ()
{
}
/* Pseudo-code
void login (QQ, password)
{
1. Verify that QQ has no value
if (QQ no value) return;
2. Verify that the password has no value
If (password has no value) return;
3. Send QQ, password to the server
}*/
int Test3 ()
{
printf ("999999999\n");
}
If the return value type is not explicitly declared, the default is int type
Test2 ()
{
printf ("888888888\n");
return 10;
}
int main ()
{
int c = Test2 ();
printf ("c=%d\n", c);
Test3 ();
Test ();
/*
int a = 100;
int B = 27;
A, B is called the actual parameter of the function, referred to as argument
int c = SUM (A, b);
printf ("a=%d, b=%d, c=%d\n", A, B, c); * *
return 0;
}