| |

VerySource

 Forgot password?
 Register
Search
View: 799|Reply: 2

Why does the actual parameter pass the value to the formal parameter, and how does it pass

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-10-19 14:30:02
| Show all posts |Read mode
Why does the actual parameter pass the value to the formal parameter, and how does it pass
Reply

Use magic Report

2

Threads

54

Posts

34.00

Credits

Newbie

Rank: 1

Credits
34.00

 China

Post time: 2020-10-19 14:45:02
| Show all posts
Because of the need to process data, let the function
So you have to pass it
Parameter passing is divided into: value passing and address passing, the former passes a copy to the function, and the latter passes the actual parameter itself to the function
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-10-19 15:30:02
| Show all posts
When function parameters are passed by value, when calling sub-functions, the actual parameter values ​​are first pushed onto the stack in order.
The access type parameter in the sub-function is actually to access the value of the actual parameter pushed onto the stack (equivalent to a copy of the actual parameter), because after the function call is completed, the function call stack will be automatically released, so you change the actual parameter and push it onto the stack The value (equivalent to the type parameter) will not affect the actual parameter
The value of has any effect.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list