First, what is a function
* any C language Program is composed of one or more program segments (small programs), each of which has its own function, which we generally call " functions ".
* For example , in C language to write a MP3 player program, then its program structure as shown:
Second, the definition of function
1. steps to define a function
* function Name: What is the function name
* function Body: What does the function do and what code it contains
2. format
* Fixed format
return value type function name (formal argument list) { function Body}
* Example
SUM (intint b) { int c = a + b;}
Iii. parameters of the function
* The pass of a parameter is a value pass
* Parameter name cannot be the same as local variable within function
Four, function notice
* cannot nest defined functions
* dead Loop call, call yourself
* cannot be defined repeatedly and can be declared repeatedly
Five, function supplement
1. main function
* return value:0, normal exit,1, abnormal exit
2. printf functions
* #include
* return Value: Length of String
Vi.#include
1. The role of #include
It's purely a file copy.
Seven, array
1. features of the array
* only one type of data can be stored, such as an array of type int , an array of type float
* data stored inside is called " element "
2. Array Definitions
* declaring the type of an array
* Declare the number of elements in an array (how much storage space is required)
3. format
Element type array name [ number of elements ];
Like what:
int ages[3];
4. Initialize
int ages[5] = {35}; int ages[3] = {2}; int a[] = {n};
Eight, string
1. What is a string
* Simple string "ASI"
* one ' i ' is a character
2. Initialization of strings
3. commonly used string processing functions
* strlen(note Chinese)
05-Function, String