C language advanced


Advanced course of C language programming (Longshu)


For students with intermediate programming ability

Key points of error avoidance and debugging (debugger and debugging strategy)

Software development: learn development tools for managing large software.


Stack memory:

 PlanThe computer’s memory is programmed Address valueThe relationship is right.

The origin of variables: early creationIdentifierIt refers to the relevant bits in memory. If the value stored in a flag changes during the running of the program, this standard is calledvariable

Principle: 1. Each data fragment has a unique address

2. Address is not allowed to be 0 (null) or negative

3. The compiler can convert flags to addresses

There are three types of memory: stack memory, heap memory and program memory


Stack frame

Function calls are often nested. At the same time, there will be information of multiple functions in the stack. Each unfinished function occupies an independent continuous area (including the parameters, local variables, return address and other related information involved in the function), which is called stack frame. When a function is called, a new stack frame is pressed in. The stack frame of the calling function becomes the caller’s stack frame, and the stack frame of the called function is called the current stack frame(rspandrbpThe memory space between them); After the function is called, the stack frame is recovered and the caller stack frame is returned. This process is automatic, distributed and destroyed by the system, without manual adjustment