MindMap Gallery Data structure (pointer)
Regarding the issues of formal parameters and actual parameters in data structures, let’s learn about them through mind maps.
Edited at 2020-11-01 18:32:14This Valentine's Day brand marketing handbook provides businesses with five practical models, covering everything from creating offline experiences to driving online engagement. Whether you're a shopping mall, restaurant, or online brand, you'll find a suitable strategy: each model includes clear objectives and industry-specific guidelines, helping brands transform traffic into real sales and lasting emotional connections during this romantic season.
This Valentine's Day map illustrates love through 30 romantic possibilities, from the vintage charm of "handwritten love letters" to the urban landscape of "rooftop sunsets," from the tactile experience of a "pottery workshop" to the leisurely moments of "wine tasting at a vineyard"—offering a unique sense of occasion for every couple. Whether it's cozy, experiential, or luxurious, love always finds the most fitting expression. May you all find the perfect atmosphere for your love story.
The ice hockey schedule for the Milano Cortina 2026 Winter Olympics, featuring preliminary rounds, quarterfinals, and medal matches for both men's and women's tournaments from February 5–22. All game times are listed in Eastern Standard Time (EST).
This Valentine's Day brand marketing handbook provides businesses with five practical models, covering everything from creating offline experiences to driving online engagement. Whether you're a shopping mall, restaurant, or online brand, you'll find a suitable strategy: each model includes clear objectives and industry-specific guidelines, helping brands transform traffic into real sales and lasting emotional connections during this romantic season.
This Valentine's Day map illustrates love through 30 romantic possibilities, from the vintage charm of "handwritten love letters" to the urban landscape of "rooftop sunsets," from the tactile experience of a "pottery workshop" to the leisurely moments of "wine tasting at a vineyard"—offering a unique sense of occasion for every couple. Whether it's cozy, experiential, or luxurious, love always finds the most fitting expression. May you all find the perfect atmosphere for your love story.
The ice hockey schedule for the Milano Cortina 2026 Winter Olympics, featuring preliminary rounds, quarterfinals, and medal matches for both men's and women's tournaments from February 5–22. All game times are listed in Eastern Standard Time (EST).
Function parameters
substance
Within the main function, define a variable to open up space for the variable
Actual parameters change in main function
The formal parameters open up space, and the space is the address. Any changes made by the function to the formal parameters are changes to the actual parameters.
The actual parameters in the main function remain unchanged
The formal parameters open up space, and the space contains values. The function call is completed and the space is released.
Pass by value
Pass the value of a variable
Actual parameters: Pass the value x of the variable to the formal parameter
Formal parameters:
Re-open a space for the received variable x
Assign the value x of the variable to this space
All operations on this variable within the sub-function are operations on numbers in the newly opened space.
After the sub-function is finished running, the newly opened space is released.
Notice:
The address of the newly opened space node x is different from the address of the actual parameter x
In the main function, the value of the x address has not changed. The operation of x in the main function by the sub-function is invalid.
If you insist on calling, it is the same as not calling
address delivery
pointer
Arguments:
The actual parameter passed is the address
For example: &a, the array is a
Formal parameters:
The formal parameter defines a pointer
For example: int *p, the array is int p[]
substance
The address of the actual parameter is stored in the space opened by the formal parameter.
The use of formal parameters by sub-functions is to indirectly change the value of the actual parameter based on the address in the formal parameter.
pointer reference(c)
Linked list (custom function)
Example: typedef struct student {}node, *list
Arguments
Within the main function: list l; creat( l);
formal parameter
Subfunction: void creat( list &l ){}
Notice:
Although there is & in the sub-function, it can be ignored within the sub-function.
Address passing application example
linked list
stack
Example: pop(stack *l, int *x)
push to stack
push(stack *l, int x)
Example: There is a[3]={1,2,0} in main, define the push function to put a number
Give e to this array
That is, the external value is given to the actual parameter, and the value of the actual parameter changes
The sub-function has finished running and the value of the actual parameter has changed.
pop
Way 1:
The sub-function is pop(stack *l, int x)
The main function is: e=pop(l,x)
The formal parameter opens up space for x, and the number taken out is placed in the space.
The sub-function call ends and the newly opened space is released.
In the main function, e=pop(l,x), the value of x is not given to e, and it is the same as if e is not called.
Way 2:
The sub-function is pop(stack *l, int *x)
The main function is: e=pop(l,&x)
The value taken out is given to x, which is equivalent to giving it to e.