当前位置:网站首页>Basic knowledge of functions and special points
Basic knowledge of functions and special points
2022-07-28 07:13:00 【So and so Xiao Lu】
- function .( High cohesion and low coupling as much as possible )
- C Classification of functions in language :
- Library function
- Custom function
- But a secret that library functions must know is : Use library functions , Must contain #include Corresponding header file .
Here, learn the above library functions by referring to the documentation , The purpose is to master the use of library functions .
- You need to learn how to use query tools :
MSDN(Microsoft Developer Network)
www.cplusplus.com
cppreference.com( English version )
cppreference.com( Chinese version )
- Formal parameters and actual parameters
Actual parameters : The parameters that are actually passed to the function , It's called the actual parameter .
The argument can be : Constant 、 Variable 、 expression 、 Functions, etc .
Shape parameter : Formal parameters refer to the variables in brackets after the function name , Because formal parameters are only instantiated when the function is called ( Within distribution
deposit receipt element ), So it's called formal parameter . Formal parameters are automatically destroyed when the function call is completed . Therefore, formal parameters only exist in functions
effect .
example : Function call exec((vl,v2),(v3,v4),v5,v6); in , The number of arguments is :( )

example :

Among them a and b Is the argument ,*px and *py It's a parameter .
- Function call :
Value transfer call , Pass a value , The address was not passed
The formal and actual parameters of a function occupy different memory blocks , Modification of a parameter does not affect the argument .
Address call
Address call is a way to call a function by passing the memory address of the created variable outside the function to the function parameter .
This parameter transfer method can establish a real relationship between the function and the variables outside the function , That is, you can directly operate inside the function
As a variable outside the function
- Nested function
Nesting is to call a function inside other functions , To recycle , Achieve an effect similar to the cycle , But it reduces the code .

- Chained access
Take the return value of one function as the parameter of another function
- Declaration of functions
If the definition function is after the use function , Declare the function before using it , The declaring function should be declared in the main function
If you define a function before using it , You can use functions directly without declaration . Therefore, we usually define the function first before using the function
- Function recursion
Recursion simply means calling your own functions , So as to achieve the effect of the function .
Two necessary conditions for recursion
There are restrictions , When this constraint is met , Recursion doesn't continue .
After each recursive call, it gets closer and closer to this constraint
example : Recursively print each bit of an integer

- The creation and destruction of function stack frames
- register
It is divided into eax、ebx、ecx、edx、 as well as ebp and esp
Every function call has to create a space in the stack
main It is also called by other functions .

__tmainCRTStartup Of this function esp and ebp Go through some operations , by main Function creates a space , And then ebx and esi and edi, To operate

边栏推荐
- DOM -- event chain, event bubble and capture, event proxy
- Raspberry pie serial port
- Three cache technologies -- localstorage, sessionstorage, cookies
- C language push box
- Nrf51822 review summary
- DOM -- page rendering, style attribute operation, preloading and lazy loading, anti shake and throttling
- A timed task reminder tool
- Standard C language summary 4
- VSphere esxi 7.0 update 3 release notes
- Results fill in the blank. How many days of national day are Sundays (solved by pure Excel)
猜你喜欢
随机推荐
NAT-网络地址转换
Esxi arm edition version 1.10 update
JS array method Encyclopedia
Multiprocessing (multiprocessing)
MOOC Weng Kai C language week 3: judgment and cycle: 1. Judgment
Small turtle C (Chapter 6 arrays 1 and 2)
Freemaker exports word with tables and multiple pictures to solve the repetition and deformation of pictures
DOM -- event chain, event bubble and capture, event proxy
开虚拟机KALI2022.2下安装GVM
Construction of Yum warehouse
PXE unattended installation management
Standard C language learning summary 9
JS data type detection and modification detection
Starting point Chinese website font anti crawling technology web page can display numbers and letters, and the web page code is garbled or blank
Redis哨兵模式及集群
DOM Foundation
Esxi community nvme driver update v1.1
codesensor:将代码转化为ast后再转化为文本向量
MOOC Weng Kai C language week 5: 1. cycle control 2. multiple cycles 3. cycle application
MySQL build database Series (I) -- download MySQL









