Value Parameters

One type of parameter is known as a value parameter. Basically, it’s a parameter that doesn’t have special modifiers. But why is it called a value parameter? Basically, such a parameter receives its input (the argument on the call site) by value. Notice that this has nothing to do with value or reference types but is simply an aspect of the invocation of a method. Passing a parameter by value means that one can simply assign to the parameter inside the method without affecting the call-site argument.

In more technical terms, the receiving method has a separate storage location for each value parameter that is not shared with the call site at all. To make this clearer, take a look at Figure 10.3, which illustrates passing an argument ...

Get C# 5.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.