C# out param code example
Example 1: out parameters c#
int initializeInMethod;
OutArgExample(out initializeInMethod);
Console.WriteLine(initializeInMethod); // value is now 44
void OutArgExample(out int number)
{
number = 44;
}
Example 2: c# out argument
// Defining Variable inline
myMethod(out Task output);
output.Start();
// Set existing variable
Task output;
myMethod(out output);
output.Start();