5.1.2 function call mechanismIn the previous study, we mentioned the concept of "call function" many times. The so-called function, that is, the execution of control of the program from the caller (a function) to the called function, while passing
Programmers who use C/C ++ to develop software often encounter this problem: sometimes there is no problem in program compilation, but the function is always reported when the link is used (the classic LNK 2001 error ), sometimes there are no errors
Program memory Layout-the point of the function call stack, the memory layout function call
[Note] This article is a summary of "programmer's self-cultivation", which is mixed with some personal understandings. If there is anything wrong, you are
The execution process of a program can be seen as a continuous function call. When a function is executed, the program will return to the next instruction (followed by the call instruction) of the calling instruction for further execution. A
6. Four ways of calling functions
The function has the following call pattern function call pattern method call Pattern Constructor Mode context mode 1. function call Pattern
To invoke, you must define the definition of the function first:
In C, suppose we have a function like this:
Int function (int A, int B)
You can use this function by using result = function. However, when a high-level language is compiled into a machine code that can be recognized by a computer, a problem arises:
Parsing function call conventions
Http://www.allaboutprogram.com/index.php? Option = content & task = view & id = 29 & Itemid = 31
HouSisong@263.net 2004.11.07 Finishing
The article comes from a post in the ABC Forum: http://bbs.allaboutprogram.com/
References:"Linux kernel design and implementation"0 SummarySystem call process for Linux:Levels such as the following:User program------>C library (i.e. API): INT 0x80----->system_call-------> System invoke Service Routines--------> Kernel
Abstract: This section describes how to obtain the member function address and call the address.
Keyword: C ++ member function this pointer call Convention
I. Usage of member function pointers
In C ++, the pointer to a member function is special.
In C, suppose we have a function like this:
Int function (int A, int B)
You can use this function by using result = function. However, when a high-level language is compiled into a machine code that can be recognized by a computer, a problem arises:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.