Output parameters
A parameter declared with an out modifier is an output parameter. An output parameter does not create a new storage location. Instead, an output parameter represents the same storage location as the variable given as the argument in the function member or delegate invocation. Thus, the value of an output parameter is always the same as the underlying variable. The following definite assignment rules apply to output parameters. Note the different rules for reference parameters described in §5.1.5. · A variable need not be definitely assigned before it can be passed as an output parameter in a function member or delegate invocation. · Following the normal completion of a function member or delegate invocation, each variable that was passed as an output parameter is considered assigned in that execution path. · Within a function member or anonymous function, an output parameter is considered initially unassigned. · Every output parameter of a function member or anonymous function must be definitely assigned (§5.3) before the function member or anonymous function returns normally. Within an instance constructor of a struct type, the this keyword behaves exactly as an output parameter of the struct type (§7.6.7).
|