I studied outthe C # keyword after reading the section on this in C # in Depth. I cannot find an example that shows why the keyword is required to simply assign the value of the return statement. For instance:
public void Function1(int input, out int output)
{
output = input * 5;
}
public int Function2(int input)
{
return input * 5;
}
...
int i;
int j;
Function1(5, out i);
j = Function2(5);
Both me and j now have the same meaning. Is it just the convenience of unsigned initialization, =or is there some other meaning that I don't see? I have seen some similar answers that mention that it takes responsibility for initializing the called here . But is all this superfluous, instead of just assigning a return value and not having a void method signature?
source
share