Definition of function :

This code's public Is the function header ,void Is the return type ,sum Is the function name , In parentheses is the parameter table ,
The next one for Loop is a function body , This is the introduction of the function
Define the location of the function :

This is the code that defines the function
The parameters of the function : How to write when calling a function : Call function :
1. If the function has parameters , When you call a function, you must pass it the number 、 Values of the correct type
2. The value that can be passed to the function is the result of the expression , This includes :

1. Literal
2. Variable
3. The return value of the function
4. The result of the calculation
If type of the function being called does not match
1. When the expected parameter type of the function is wider than the given value type of the calling function , The compiler can quietly convert types for you
2.char ——>int——>double
3. When the expected parameter type of the function is narrower than the value type given when calling the function , Need you to write cast
4.(int)5.0
5. When there is no conversion between the expected parameter type of the function and the type of the value given when the function is called ——> no way !



![When Jerry's serial port is set up, it prints garbled code, and the internal crystal oscillator is not calibrated [chapter]](/img/6d/96b3326a201bf17d436c1af7834232.png)
![Develop small programs and official account from zero [phase I]](/img/02/77386ba3fe50b16018f77115b99db6.png)

![[QT] Chapter 3 and 4: window components and layout management](/img/e6/fb35566c227c4a8e564594d40e4eab.png)


