当前位置:网站首页>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

边栏推荐
- shell---循环语句练习
- Small turtle C (Chapter 5 loop control structure program 567) break and continue statements
- Easypoi export interlaced style settings
- MOOC Weng Kai C language week 8: pointer and string: 1. Pointer 2. Character type 3. String 4. String calculation
- Install Nessus under win
- Esxi arm edition version 1.10 update
- 360 compatibility issues
- Differences and relationships among NPM, Yran and NPX
- easypoi导出隔行样式设置
- Three cache technologies -- localstorage, sessionstorage, cookies
猜你喜欢

爬虫学习总结

win下安装nessus

metasploit渗透ms7_010练习

freemarker合并单元格,if、else标签的使用,null、空字符串处理

MOOC Weng Kai C language week 8: pointer and string: 1. Pointer 2. Character type 3. String 4. String calculation

Neo4j运行报错Error occurred during initialization of VM Incompatible minimum and maximum heap sizes spec

Nrf51822 review summary

Media set up live broadcast server

MySQL查询父节点下面的所有子孙节点,查询用户列表时多级(公司)部门处理,根据反射,递归树形结构工具类

codesensor:将代码转化为ast后再转化为文本向量
随机推荐
New, let, VaR, const and temporary deadband. The difference between XML and JSON
Results fill in the blank shopping list (teach you to solve it with Excel)
MOOC Weng Kai C language week 6: arrays and functions: 1. Arrays 2. Definition and use of functions 3. Parameters and variables of functions 4. Two dimensional arrays
Standard C language learning summary 8
MySQL queries all descendant nodes under the parent node. When querying the user list, it is processed by multi-level (company) departments. According to reflection, it recurses the tree structure too
Redis哨兵模式及集群
Starting point Chinese website font anti crawling technology web page can display numbers and letters, and the web page code is garbled or blank
Construction of Yum warehouse
Easypoi one to many, merge cells, and adapt the row height according to the content
Easypoi export interlaced style settings
Result fill in the blank (dfs*c language)
PXE unattended installation management
MOOC Weng Kai C language week 7: array operation: 1. array operation 2. Search 3. preliminary sorting
Use powercli to create a custom esxi ISO image
JS string method Encyclopedia
Neo4j运行报错Error occurred during initialization of VM Incompatible minimum and maximum heap sizes spec
232(母)转422(公)
Implementation method of converting ast into word vector before converting word vector
Standard C language learning summary 3
Uni app double click event simulation