return type c# reference code example
Example 1: c# function return
// To create a function with a return value, note the variable
// type in front of the function name and add a return of the
// same type at the end.
static string lastFirst(string firstName, string lastName)
{
string separator = ", ";
string result = lastName + separator + firstName;
return result;
}
Example 2: cannot initialize a by-value variable with a reference
// must declare variable as ref as well!
ref int x = ref SomeClass.variable;