在C#中的参数/参数之间的差异 [英] Difference between arguments/parameters in C#
问题描述
可能重复:结果
<一href=\"http://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter\">What's参数和参数?
是什么参数与放大器之间的差异;在C#中的参数?
What is the difference between an argument & a parameter in C#?
他们是同样的事情?
推荐答案
好了,既不关键字是在语言present,所以问题是有些模糊。可以做的最好的是看每个术语是如何在C#语言规范使用(1.6.6.1参数):
Well, neither keyword is present in the language, so the question is somewhat vague. The best that can be done is to look how each term is used in C# language specification (1.6.6.1 "Parameters"):
的参数的用于值或变量引用传递给方法。方法的参数从参数获取它们的实际值的被调用方法时指定的。
Parameters are used to pass values or variable references to methods. The parameters of a method get their actual values from the arguments that are specified when the method is invoked.
所以,参数指的名称的,和论据指的值的绑定到这些名称。例如:
So, "parameters" refer to names, and "arguments" refer to values bound to those names. E.g.:
void Foo(int x, int y); // x and y are parameters
Foo(1, 2); // 1 and 2 are arguments
这篇关于在C#中的参数/参数之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!