常常可以发现bug的原因是调用者发送了类型错误的参数或数量错误的参数,或者实际参数和形式参数的次序不匹配。
Often, you can trace the origin of a bug back to a caller that's sending the wrong type of argument, the wrong number of arguments, or a mismatch between the order of actual and formal arguments.
也能提醒实际参数和形式参数的使用过程:调用一个函数的时候,把实际参数的值赋给了形式参数。
It is also a reminder about how arguments and parameters work: when you call a function, the arguments are assigned to the parameters.
实际参数:当函数被调用的时候,提供给函数的值。这个值会被函数接收,赋给函数内部的形式参数。
A value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function.
应用推荐